Could not determine buffer format

scanmaster_k

05-02-2008 09:25:46

Hi, first time usinig OgreAL, Im trying to use sound in a 3d space, if I create one sound and then use getsound, not attaching it to any node or anything, just play it once in a while it works, but when I try to create instances of the same sound I get this message.
!!WARNING!! Could not determine buffer format! Defaulting to MONO

Any thoughts about this?
Second question is there like a written tutorial on how t use OgreAL or is there only the demos?



Thanks
Scanmaster_K

CaseyB

05-02-2008 14:55:14

That warning comes from parsing the sound in, so it should only ever happens when you load the sound for the first time, since every subsequent instance actually references the same buffer. What kind of a file are you loading in? Is it a WAV?

There are currently no tutorials that I know of, only the demos. There is a [u]book[/u] that has a chapter on game programming using Ogre and OgreAL. It's a little pricey and there is only the one chapter on Ogre, the rest of the book in teaching basic C++, but it's a really good book to learn from if you are just learning.

scanmaster_k

05-02-2008 15:19:47

Thanks for the reply, and yes it is a wav file.

CaseyB

05-02-2008 15:41:34

Can you send me the file? I have put together my own wav parsing and it could be that it's just not robust enough. I can't promise I'll get to it soon, but I will do my best. Until then, having it default to mono is really what you want anyway for a sound that you are going to play in 3D space.

scanmaster_k

05-02-2008 16:43:24

I've sent you the file.

A problem I thought was directly related to this is that I can't hear anything by doing this, only when I use getSound do I actually hear anything, and after i use sound->play and ask if it is playing I get a false.

Edit: When I only use createSound once I don't get the warning message, only when I use create several instances.

Scanmaster_K

CaseyB

05-02-2008 17:06:02

Can you post your code so I can see how you're initializing OgreAL and creating the sounds?

scanmaster_k

05-02-2008 17:10:29

In my game state
_soundManager = new OgreAL::SoundManager();

then in my factory, for each object I create I do
OgreAL::Sound *sound = OgreAL::SoundManager::getSingletonPtr()->createSound((name + "Sound"), "test.wav");
sound->setGain(2);
sceneNode->attachObject(sound);


In my player class I do
_torsoNode->attachObject(OgreAL::SoundManager::getSingletonPtr()->getListener());

I then call sound->play() in a OgreNewt collision callback function



Scanmaster_K