[Bf-committers] Game engine audio recode

Alexander Ewering blender at instinctive.de
Sun Dec 26 13:25:44 CET 2004


Hello,

I hope everyone had a nice and sensible christmas  :)

Yesterday, I've tried game engine sound on yet another box (the third
one), and guess what - it didn't work.
The three results I got from three different machines (two different
linux distributions, one win32) are:

1) Only looping sounds work

- or -

2) No sound at all

- or -

3) Segfault in acBuildAudioCVT()

This is the point where I will definitely start completely recoding the
audio. I'll get it finished in a matter of a few days, and if there is
interest, it will be ready and included in 2.37.

The plan is to do this in instinctive-blender. This is no problem, because
I never touched the rest of the game engine code, so I can directly commit
the modified files to the official tree.
Before I do that, I could of course just as easily hand out patches or
testing builds or source snapshots of the gameengine/ directory for others 
to test.

I will use SDL for raw sound output only, and do the mixing/panning/
attenuation myself.

One problem with this is, of course, that I have no single machine available
where the *current* game engine sound works, so I cannot compare the scaling
of Volume with distance to the reference files. So that will need some
experimenting.

On the whole though, it seems that either

1) hardly anyone uses the game engine

2) hardly anyone uses sound in the game engine

or

3) it hardly works for anyone anyway

This I derive from a poll I entered at elysiun, which got a mere 2 votes in
3 days:

http://www.elysiun.com/forum/viewtopic.php?p=335689


There are probably some questions I'll have during this recode, mainly
because the sound code will be in C, but needs to be called from C++, and
because of the special case of the blenderplayer/plugin and the need to
include (link) SDL into it. Maybe someone can already prepare that, so
that SDL gets linked.

Concerning file formats: What is the current status of the game engine?
>From my knowledge, Blender doesn't support loading anything else than
WAV files anyway, also for the gameengine.

It would of course be nice if it could handle MP3 files, which are smaller,
which is crucial for inclusion in runtimes. It would then be best to
have realtime decoding of them, instead of loading and then converting
to raw PCM, as that will take a lot of memory instead of disk space.

The MP3 part I will try later, first I want to see a game engine with
working sound for the first time in my life :-)

Expect further questions :-)

| alexander ewering              instinctive mediaworks
| ae[@]instinctive[.]de   http://www[.]instinctive[.]de


More information about the Bf-committers mailing list