summaryrefslogtreecommitdiffstats
path: root/src/read-sound-file.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-06 12:17:58 +0000
committerLennart Poettering <lennart@poettering.net>2008-06-06 12:17:58 +0000
commit617c912e950d582c5690e558b28fa1070f9b8263 (patch)
treee0c2ef90b6fcd291f3466a2c703d07b208981d06 /src/read-sound-file.c
parent0cc6ddf46d77f0f8c657588b8373e1e87512d578 (diff)
unify double inclusion defines src/sound-theme-spec.h src/read-wav.h src/read-vorbis.h src/proplist.h src/mutex.h src/llist.h src/common.h
git-svn-id: file:///home/lennart/svn/public/libcanberra/trunk@52 01b60673-d06a-42c0-afdd-89cb8e0f78ac
Diffstat (limited to 'src/read-sound-file.c')
-rw-r--r--src/read-sound-file.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/read-sound-file.c b/src/read-sound-file.c
index 3a1f93c..b3a369f 100644
--- a/src/read-sound-file.c
+++ b/src/read-sound-file.c
@@ -196,3 +196,13 @@ size_t ca_sound_file_get_size(ca_sound_file *f) {
else
return ca_vorbis_get_size(f->vorbis);
}
+
+size_t ca_sound_file_frame_size(ca_sound_file *f) {
+ unsigned c;
+
+ ca_assert(f);
+
+ c = ca_sound_file_get_nchannels(f);
+
+ return c * (ca_sound_file_get_sample_type(f) == CA_SAMPLE_U8 ? 1 : 2);
+}