Audio: Function to get channel count of a sound, for [#25062] Sound Actuator - Positi...
authorJoerg Mueller <nexyon@gmail.com>
Wed, 22 Dec 2010 16:07:57 +0000 (16:07 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Wed, 22 Dec 2010 16:07:57 +0000 (16:07 +0000)
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/sound.c

index 2d4ea812f5746a787630d10425c55241352c8981..cf77049b59965da7c2874c90d062d237c0ea40d3 100644 (file)
@@ -96,4 +96,6 @@ int sound_scene_playing(struct Scene *scene);
 
 int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, float start, float end);
 
+int sound_get_channels(struct bSound* sound);
+
 #endif
index 443ed1f79877fa21a2d2229b2e6647055ad5ba6b..3dc2221e0c80a81adb84326cbb4847da5ea590cd 100644 (file)
@@ -484,3 +484,12 @@ int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, flo
        return AUD_readSound(limiter, buffer, length);
        AUD_unload(limiter);
 }
+
+int sound_get_channels(struct bSound* sound)
+{
+       AUD_SoundInfo info;
+
+       info = AUD_getInfo(sound->playback_handle);
+
+       return info.specs.channels;
+}