GSoC 2011: 3D Audio

Hi!

You might want to read this first: http://audaspace.wordpress.com/2011/07/07/gsoc-2011-3d-audio/

Really noticable changes will be done starting with the third milestone, so you wonder why I’m posting here?

I need testers, that try out audio in GSoC builds of the pepper or salad branch and complain about bugs/problems they find, as there has been changed a lot in the whole blender audio code during the first milestone!

Regards!

Is the attachment of sounds to empties in 3D space made possible with these improvements?

That’s the target. Not to empties but special speaker objects.

All right. New improvements to Audio Engine!
Keep up the awsome work. Downloading a pepper build right now and will send feed backs.

Are the 3D effects on the sound all discreet panning effects. That is are the sounds sent to particular channels, or will they be spatialised to surround via stereo?

Could I spatially mix sound sources from the VSE to a 3D space by placing sources in a 3D field with a master audience in the middle?

Finally, does the tool set provide any additional sound processing to other aspects of Blender to modify audio. I gather there is pitch control, would there be any EQ. I often hear EQ effects in games where walls and objects occlude sound.

Wow, an invitation to complain about audio. Who can resist.

I offer up that I mix audio on my machine all the time and Ableton and Sonar both work fine. If you conclude I may have hardware or software issues, I offer up success with commercial products as evidence to dismiss that claim.

I pulled down the salad branch 38215 from your link.

I performed this basic test which I suggest becomes your benchmark for success.

Add three red book audio mono waves to the VSE. I used 16 bit 44.1Khz wave files I recorded in my own studio.
Right off the bat I notice there is no panning in the VSE. Add that to the system please.
Also there is no soloing, add that to audio tracks in the VSE. Mute would be nice as well.

So there I am in the VSE with three mono wave files about 3 minutes each.

During playback I hear the audio along with crackling so I change the synch in the timeline to frame dropping and it has no effect. The crackling persists.

So I perform the next test and render out an xVid AVI. Sure enough, the crackling is in the rendered output.

At this point I would suggest you try my test and fix the crackling bug. No matter how many bells and whistles you add to the system they are meaningless unless you can fix the final rendered output.

Playing with the settings in User Preferences does help a bit. I set my samples to 16 bit unsigned. And Increased the buffer to 4096. But there is still an underlying crackle/sizzle that should not be there.

The linux build i downloaded had some dependency issues, so i decided to test a new build later.

btw is audaspace threaded for the game engine?
coz i have a good feeling that it is.
Thanks

I wasnt suggesting that any of this works in vse, only asking if it could. I have not had any crackling from audio in vse just sync issues. Blender prefers wavs but im not sure what frequency.

Are the 3D effects on the sound all discreet panning effects. That is are the sounds sent to particular channels, or will they be spatialised to surround via stereo?

The later, the sound is panned correctly between the two nearest speakers.

Could I spatially mix sound sources from the VSE to a 3D space by placing sources in a 3D field with a master audience in the middle?

The VSE is not part of this system. The “master audience” will be the camera.

Finally, does the tool set provide any additional sound processing to other aspects of Blender to modify audio. I gather there is pitch control, would there be any EQ. I often hear EQ effects in games where walls and objects occlude sound.

Such advanced effects are not planned at the moment. Maybe if there’s time at the end.

Right off the bat I notice there is no panning in the VSE. Add that to the system please.
Also there is no soloing, add that to audio tracks in the VSE. Mute would be nice as well.

Panning is on the todo list, I just have to wait for a solution to an animation system problem.
Soloing and muting are there, try playing with Alt, Shift and H (H = mute selected, Alt+H = unmute selected, Shift+H = mute unselected, Alt+Shift+H = unmute unselected).

During playback I hear the audio along with crackling so I change the synch in the timeline to frame dropping and it has no effect. The crackling persists.

I noticed the crackling myself and will definitely look into it, could you please check if you have the same problem in official 2.5 at the moment? Also this has nothing to do with the synch method. Anyway you’ll only get real synchronisation with AV-sync, not frame dropping.

The linux build i downloaded had some dependency issues, so i decided to test a new build later.

btw is audaspace threaded for the game engine?

You might want to report that issue to the builder! And yes, audaspace is always threaded to a needed extent.

Blender prefers wavs but im not sure what frequency.

Wrong, since 2.5 blender doesn’t care if it’s wav or not, the only thing you should keep in mind is to choose a format that’s easy to seek in for the underlying libraries (ffmpeg and libsndfile), wav is good to seek in, but not especially prefered. The frequency also doesn’t matter, but you might want to keep your whole pipeline in one frequency (input files same frequency as output) to get optimal results.

Regards

Thanks thats very helpfull

Hi neXyon,

I realise this is probably not the place to ask for such a feature, but I wonder if you could let me know who to ask for this? In a project some time ago I had a small problem with sound tracks: basically I added a matroska video file to the VSE and it found the video and first audio track, but that was just the music with the voices tuned down - I needed the other sound tracks with the voices and all. I couldn’t find a way to do this in Blender so I ended up using Audacity to merge all the sound together in one track and then import that in Blender. Is the feature there and I just didn’t find it? Or who could I approach for a feature request like this?

Thank you for your attention. Keep up the great work, and good luck with your project!

Hi,
finally solved the dependency issues and made a linux i386 pepper build r38213 to work on ubuntu 11.04 and done a quick test on game engine part.

i added just a sound actuator (no music file loaded) and run the game and blender crashed.
i can upload the blend file if you want.
if the logic bricks are properly connected then the sound is played as usual.

what else do i need to test?
VSE?

During playback I hear the audio along with crackling so I change the synch in the timeline to frame dropping and it has no effect. The crackling persists.
This is fixed in pepper now for a week already.

I couldn’t find a way to do this in Blender so I ended up using Audacity to merge all the sound together in one track and then import that in Blender. Is the feature there and I just didn’t find it? Or who could I approach for a feature request like this?
Sorry, there is no mechanism to select a stream of a file, so always the first audio stream in a file is being used. For now you have to demux externally.

i added just a sound actuator (no music file loaded) and run the game and blender crashed.
i can upload the blend file if you want.
if the logic bricks are properly connected then the sound is played as usual.

what else do i need to test?
VSE?
Ah yeah, without a sound set, the soundactuator doesn’t get initialised properly and blender crashes. Will fix this.

Yes, feel free to test the VSE.

Regards

[EDIT]The bug with the GE crash is fixed in pepper now[/EDIT]

Really cool ideas neXyon!

I’m having a hard time compiling on Xcode though. I’m usually able to compile Pepper, but lately this error keeps popping up :
https://lh5.googleusercontent.com/-KWP13KhzsxI/Tit7QTqwrRI/AAAAAAAABAg/6cURizR7JwA/s800/Screen%252520shot%2525202011-07-23%252520at%2525207.56.12%252520PM.png

What are those closing parenthesis doing there in those two lines? They are at least not in svn, so are you sure your checkout is correct? See https://svn.blender.org/svnroot/bf-blender/branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h

Thanks neXyon! I deleted source and did a fresh checkout - that fixed it. There’s other errors, but I doubt they’re from your contribution.

Any chance this could be expanded to binaural rendering? Headphones are much cheaper then a multi-speaker setup.

Hi!

I committed a rewrite of the sequencer related audio stuff today, if anyone wants to try to test this and report bugs here, please feel free to do so, I haven’t had much time to test it yet, any build with revision 38730 or later is fine.

About binaural rendering: If there’s enough time and motivation when the main parts are finished, this is for sure something interesting, but it also depends on findingt good and free to use HRTFs.

Regards

What sort of stuff is going to show up in the sequencer?

Nothing new, but the audio related part got a complete rewrite, so if it still works, that’s the new thing. :wink: