[Bf-committers] Sound stuff

neXyon nexyon at gmail.com
Tue Jun 2 13:58:11 CEST 2009


as Ton already announced in the meeting minutes mail, I'm working on 
sound stuff.

--- Short about:

A already two months old proposal is here: 

To say it short:

current sound stuff in blender is a pain, there are at least 3 more or 
less seperated code parts that handle sound:

* the sequencer, handles sound completely on its own (SDL)
* editsound.c, handles the sound structures bSound and bSample, has 
nothing to do with sound really, except showing the wave in the audio window
* SoundSystem, the GE sound system (OpenAL)

Why not use TinySND (the old GSoC sound project): because I personally 
think it's half-baked, has to much dependencies and doesn't really fit 
the needs properly. (Anyone wants to discuss about that?)

---- More sound formats for 2.4x BGE:

Campell suggested me to write a loading function for the old sound 
system (SoundSystem) to make it possible to play other formats in BGE, 
not only wav. So I did a quick (but  - as far as I tested - working 
flawlessly) implementation of that function and it works perfectly with 
wav files. But then I noticed that for other files, the editsound.c 
sound code disturbs. It's really desperating working with this - sorry 
for the term - crap of code, so I only bypass the sound format checking 
routines in editsound.c to get the function work.

The result of this bypass is, that you can load any file resulting in 
simply no playback and the wave isn't displayed in the audio window.

Nevertheless I have attached the patch which includes the function and 
the bypassing changes, if you test it, remember to switch on 
WITH_FFMPEG. The internal SoundSystem doesn't seem to get that define 
during compilation, so I #defined it myself there, so if you try to 
compile without ffmpeg and forget to remove the define, you'll get a 
compilation error.

I'm not really motivated to also refactor editsound.c to fix the 
problems of my hacks, to get any sound format working in future blender 
2.4x. I more like to concentrate on a new sound system for 2.5, but if 
anyone of you is interested to continue that 2.4x BGE sound work, feel 
free, I can give support if you want so, simply contact me!

---- Sound in 2.5:

So, I'm currently working on a new sound library, that should be able to 
handle every sound feature needed by blender. For the integration in 
blender, I think the old sound structures will have to be removed, 
they're simply unusable at the moment.

The library will be in C++ like the current SoundSystem and with a C 
backend to use it. It will use FFMPEG to read sound files (I think we 
shouldn't include an own wav loading function, so if blender's compiled 
without FFMPEG => no sound) and for the output I'm currently working 
with SDL, but this is pluggable. My target is to let the user decide 
which output driver he wants, just like every better multimedia app, as 
soon as we have programmed other output drivers.

Also should the library satisfy Peter Schlaile, because it's possible to 
let the sequencer do as much audio processing as it wants to, the api 
design is very flexible in this respect.

---- Current state and prospects:

Currently I program the library separately in a C++ project: sound 
output works through SDL, and I'm currently having trouble with audio 
resampling of ffmpeg (something the function provided in the patch, 
doesn't do, so don't worry!), as soon I have that working, I'll finish 
the class design of the library, update it in the proposal and then I'll 
report again!

Meanwhile, I'd like to hear all your thoughts, recommendation and 
constructive criticism.



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
Url: http://lists.blender.org/pipermail/bf-committers/attachments/20090602/95436220/attachment.txt 

More information about the Bf-committers mailing list