Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/audaspace/CMakeLists.txt1
-rw-r--r--source/blender/blenkernel/BKE_sound.h2
-rw-r--r--source/blender/blenkernel/intern/sound.c10
-rw-r--r--source/gameengine/Converter/KX_ConvertActuators.cpp17
4 files changed, 18 insertions, 12 deletions
diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt
index 8b7cb1d9e69..25510ebd2a5 100644
--- a/intern/audaspace/CMakeLists.txt
+++ b/intern/audaspace/CMakeLists.txt
@@ -116,6 +116,7 @@ set(SRC
intern/AUD_ReadDevice.h
intern/AUD_Reference.h
intern/AUD_ReferenceHandler.cpp
+ intern/AUD_ResampleFactory.h
intern/AUD_ResampleReader.cpp
intern/AUD_ResampleReader.h
intern/AUD_SequencerEntry.cpp
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index e1b6ff02bc4..fac5bf1cfd2 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -134,8 +134,6 @@ void sound_free_waveform(struct bSound* sound);
void sound_read_waveform(struct bSound* sound);
-int sound_get_channels(struct bSound* sound);
-
void sound_update_scene(struct Scene* scene);
void* sound_get_factory(void* sound);
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 985fef974d3..cdb509ab8e1 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -641,15 +641,6 @@ void sound_read_waveform(struct bSound* sound)
}
}
-int sound_get_channels(struct bSound* sound)
-{
- AUD_SoundInfo info;
-
- info = AUD_getInfo(sound->playback_handle);
-
- return info.specs.channels;
-}
-
void sound_update_scene(struct Scene* scene)
{
Object* ob;
@@ -769,6 +760,5 @@ void sound_seek_scene(struct bContext *UNUSED(C)) {}
float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
-int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
#endif // WITH_AUDASPACE
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp
index 7b9cba7770b..9621d05b5cc 100644
--- a/source/gameengine/Converter/KX_ConvertActuators.cpp
+++ b/source/gameengine/Converter/KX_ConvertActuators.cpp
@@ -46,6 +46,7 @@
#ifdef WITH_AUDASPACE
# include "AUD_C-API.h"
+# include "AUD_ChannelMapperFactory.h"
#endif
// Actuators
@@ -406,7 +407,23 @@ void BL_ConvertActuators(char* maggiename,
"\" has no sound datablock." << std::endl;
}
else
+ {
snd_sound = *reinterpret_cast<AUD_Reference<AUD_IFactory>*>(sound->playback_handle);
+
+ // if sound shall be 3D but isn't mono, we have to make it mono!
+ if(is3d)
+ {
+ AUD_Reference<AUD_IReader> reader = snd_sound->createReader();
+ if(reader->getSpecs().channels != AUD_CHANNELS_MONO)
+ {
+ AUD_DeviceSpecs specs;
+ specs.channels = AUD_CHANNELS_MONO;
+ specs.rate = AUD_RATE_INVALID;
+ specs.format = AUD_FORMAT_INVALID;
+ snd_sound = new AUD_ChannelMapperFactory(snd_sound, specs);
+ }
+ }
+ }
KX_SoundActuator* tmpsoundact =
new KX_SoundActuator(gameobj,
snd_sound,