:audio(warning): stereo sound will not be spatialized

Hi

I just began to learn python and panda and ran into following problem:

I’d like to create a room with TV and a show running on the TV. So everything works perfectly, beside the sound of the show. I’d like if it fades out when i move away from the TV buts this is not happening. Instead I hear it in the whole world.

Panda also gives me following warning:

:audio(warning): stereo sound /c/Source/Lab3/src/Sounds/glenn_launch.wav will not be spatialized

My method, to create the sound looks like this:


def load_audio(self, filepath, volume, min_distance, drop_off, attach_node):
        
        audio3d = Audio3DManager.Audio3DManager(base.sfxManagerList[0], base.camera)
        audio3d.setDropOffFactor(drop_off)
        sound = audio3d.loadSfx(filepath)
        sound.setVolume(volume)
        audio3d.attachSoundToObject(sound,attach_node)
        audio3d.setSoundMinDistance(sound,min_distance)
        
        sound.play()

It would be great if somebody could help me. I tried to solve this problem by myself, but I’m working on it for hours now.

greets

This is an OpenAL thing: if your sound is stereo, it will not be affected by a position in the 3d world. If you convert your stereo sound file to mono, it should work.

Thank you for you quick reply! Unfortunately it doesn’t worked.

I tried what you said and converted my stereo .wav file with audacity into a mono file, but it still gives me the same warning and behavior of the program.

Are you sure you converted it to a mono file, and not just to a stereo file with the same data in both channels? By default, audacity always saves its output as a stereo file, unless you change the project parameters.

David

Great!

Thanks for the hint! I deleted one track in audacity but didn’t set the other one on mono.

Now it’s working