New FMOD SoundManager available in Wiki

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

It's wrapping OpenAL, so it does. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
zerotm
Gnoblar
Posts: 3
Joined: Fri Dec 19, 2008 10:16 pm

Post by zerotm »

Hm nice, ill go check it out then thanks.
Stickymango
Hobgoblin
Posts: 540
Joined: Wed Nov 17, 2004 4:36 pm
Location: Middlesbrough, England

Post by Stickymango »

Hey Jacmoe, thanks for the forwarding :D

OgreOggSound supports .ogg/.wav audio files so if thats what your using then please do check it out, any problems, visit the forum and I'll do what I can to help you out.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Stickymango wrote:Hey Jacmoe, thanks for the forwarding :D
I am very glad that you decided to share your OgreOgg library. It's the one and only Ogre sound wrapper we've got. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
mickeyren
Greenskin
Posts: 142
Joined: Thu Dec 18, 2008 11:32 am

fade out sound

Post by mickeyren »

Hi

would someone know how to fade out the sound/music?

THanks
Stickymango
Hobgoblin
Posts: 540
Joined: Wed Nov 17, 2004 4:36 pm
Location: Middlesbrough, England

Re: New FMOD SoundManager available in Wiki

Post by Stickymango »

Which library are you using?
mickeyren
Greenskin
Posts: 142
Joined: Thu Dec 18, 2008 11:32 am

Re: New FMOD SoundManager available in Wiki

Post by mickeyren »

The FMOD / SoundManager class which is found in the wiki and this dedicated thread.

Also, would anyone have an idea why the sound would suddenly not play after playing for a few times? I'm using the SoundManager still.

I just do this whenever i want to make an explosion sound:

Code: Select all

int channelFireGun =  INVALID_SOUND_CHANNEL;		
gSoundMgr->PlaySound( gExplosionSoundId, mSceneMgr->getSceneNode("exnode"), &channelFireGun );	
gSoundMgr->Set3DMinMaxDistance(channelFireGun, 100.0, 1000.0);	
therealwoge
Gnoblar
Posts: 14
Joined: Fri Jan 09, 2009 5:11 am

Re: New FMOD SoundManager available in Wiki

Post by therealwoge »

Will the FMOD Sound Manager work with FMOD Designer? And if so, is it fairly straight forward?

Cheers for listening. :)
McNugget
Kobold
Posts: 36
Joined: Sat Jun 25, 2005 11:27 am

Re: New FMOD SoundManager available in Wiki

Post by McNugget »

Any luck solving my initial problem with the gimble lock?
User avatar
AntonTheManton
Greenskin
Posts: 100
Joined: Sun Jan 14, 2007 1:47 am

Re: New FMOD SoundManager available in Wiki

Post by AntonTheManton »

Might be worth pointing out that the wrapper doesn't do any validation, and keeps track of SceneNodes that you pass it; hence if you are going to be removing scenenodes during runtime then you will need to modify the wrapper. Took me a while to figure that one out... :wink:
Muscleator
Gnoblar
Posts: 9
Joined: Sun Nov 16, 2008 2:43 pm

Re: New FMOD SoundManager available in Wiki

Post by Muscleator »

Hello!

I have 2 interesting questions:

1. How do you use the SoundManager to deallocate sounds when they are not needed anymore?

2. After looking around in the code I see a piece of code I think look peculiar, SoundManager::IncrementNextSoundInstanceIndex. It is meant to increase the size of a vector when it runs out of space but isn't this done automatically by STL? Anyone of you have any clue about that, to me it does not make much sense.
jtpsoft
Greenskin
Posts: 115
Joined: Wed Feb 01, 2006 1:22 pm

Re: New FMOD SoundManager available in Wiki

Post by jtpsoft »

Hello^^
I have a weird problem with fmod in ogre and I hope you can help me..
My problem is that my program can play only some file while other don't work at all.I've tried with various mp3,wav,aif,ogg,wmv etc with various different codec settings but with no good results.The sounds with these files don't start.How can i fix this?What codec are certanly supported in fmod?

Regards in advance
Muscleator
Gnoblar
Posts: 9
Joined: Sun Nov 16, 2008 2:43 pm

Re: New FMOD SoundManager available in Wiki

Post by Muscleator »

jtpsoft wrote:Hello^^
I have a weird problem with fmod in ogre and I hope you can help me..
My problem is that my program can play only some file while other don't work at all.I've tried with various mp3,wav,aif,ogg,wmv etc with various different codec settings but with no good results.The sounds with these files don't start.How can i fix this?What codec are certanly supported in fmod?

Regards in advance
I am currently not using FMOD, but with it I uses to play oggs and wavs. Positional, i.e. 3D, sounds have to be mono I believe. There are also some bugs in the code on the wiki.
For more detail you could post the same question to the FMOD forums, or learn FMOD (highly suggested), so that you can improve the wiki code.
(I modified the code from the wiki in my own game but now it is too bound to the game itself)

My first suggestion is to remove the "SoundManager::IncrementNextSoundInstanceIndex" function in the code, which in my opinion is utter madness in my opinion, it is not needed and it only makes the code less clear.

Good luck FMOD is much better than the other sound libraries.
Muscleator
Gnoblar
Posts: 9
Joined: Sun Nov 16, 2008 2:43 pm

Re: New FMOD SoundManager available in Wiki

Post by Muscleator »

Otherwise it should work with all kinds of wavs and all kinds of oggs, at least that is my assumption and that makes sense, since FMOD is a commercial and great sound library.
User avatar
jheld
Halfling
Posts: 90
Joined: Sat Feb 21, 2009 10:32 am

Re: New FMOD SoundManager available in Wiki

Post by jheld »

I'm also getting this error in the ogre log (using Shaggoth):
20:52:46: SoundManager::CreateSound could not load sound 'music.wav' FMOD Error:End of file unexpectedly reached while trying to read essential data (truncated data?).
setting up

Code: Select all

		SceneNode * soundNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("soundNode");
		soundNode->setPosition(0,0,0);
		backgroundSound1 = soundMgr->CreateLoopedSound(Ogre::String("music.wav"));
		backgroundSoundChannel1 = INVALID_SOUND_CHANNEL;
		soundMgr->PlaySound(backgroundSound1, soundNode, &backgroundSoundChannel1);
and at framestarted (doubt it matters but it's here for completion),

Code: Select all

		soundMgr->PlaySound(backgroundSound1, soundNode, &backgroundSoundChannel1);
		soundMgr->Set3DMinMaxDistance(backgroundSoundChannel1, 2.0, 50000.0);
		soundMgr->FrameStarted(soundNode, evt.timeSinceLastFrame);
I've stored the .wav file in "C:\OgreSDK\media\sounds" and updated the paths in resources.cfg. It appears as if the .wav is found by the file manager (yes, I checked the correct path) but fmod system->createSound fails. Really stumped here. Has anyone else ran into this and know the solution? It's a bit of an old-ish article as well. Anyone have any updates?

Cheers
Jason
User avatar
jheld
Halfling
Posts: 90
Joined: Sat Feb 21, 2009 10:32 am

Re: New FMOD SoundManager available in Wiki

Post by jheld »

the deafening sound of crickets. anyone? bueller?
User avatar
AntonTheManton
Greenskin
Posts: 100
Joined: Sun Jan 14, 2007 1:47 am

Re: New FMOD SoundManager available in Wiki

Post by AntonTheManton »

sounds most like a corrupted wav file/odd format. have you tried another one from a different source?
I have a slightly further developed sound manager that wraps alternatively OpenAL or Fmod Ex. I could upload it if there's a general demand for another one.
User avatar
Xplodwild
Goblin
Posts: 231
Joined: Thu Feb 12, 2009 3:49 pm
Location: France
x 13

Re: New FMOD SoundManager available in Wiki

Post by Xplodwild »

Also, I don't think it's needed to do PlaySound each frame, once suffice.
stu4guvnor
Gnoblar
Posts: 1
Joined: Tue Oct 19, 2010 4:26 pm

setFileSystem()

Post by stu4guvnor »

My first time posting on these forums:)

I have a question about the SoundManager.cpp file.
Inside Initialize(), when system calls the setFileSytem function (as seen below):
result = system->setFileSystem(FModOpen, FModClose, FModRead, FModSeek, 2048);

I get an error saying setFileSystem() doesn't take 5 arguments. It's missing two other arguments being passed of type FMOD_FILE_ASYNCREADCALLBACK & of type FMOD_FILE_ASYNCCANCELCALLBACK. Did anyone else have this issue and, if so, how did you solve this problem?

Apologies if this is a silly question:D
Erebus
Gnoblar
Posts: 6
Joined: Sat Jan 30, 2010 10:26 am

Re: setFileSystem()

Post by Erebus »

stu4guvnor wrote:My first time posting on these forums:)

I have a question about the SoundManager.cpp file.
Inside Initialize(), when system calls the setFileSytem function (as seen below):
result = system->setFileSystem(FModOpen, FModClose, FModRead, FModSeek, 2048);

I get an error saying setFileSystem() doesn't take 5 arguments. It's missing two other arguments being passed of type FMOD_FILE_ASYNCREADCALLBACK & of type FMOD_FILE_ASYNCCANCELCALLBACK. Did anyone else have this issue and, if so, how did you solve this problem?

Apologies if this is a silly question:D
I just tried out the sound manager and got the same error, no solution yet however, if anyone knows how to fix this that would be appreciated.
lordmonkey
Kobold
Posts: 27
Joined: Fri Mar 25, 2011 5:48 pm

Re: New FMOD SoundManager available in Wiki

Post by lordmonkey »

I get the same error. Hopefully somebody is going to fix this soon .... :(
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218

Re: New FMOD SoundManager available in Wiki

Post by Jabberwocky »

This FMOD SoundManager was written a long time ago (original post is 2006), possibly for an older version of FMOD than you're using. The newer version of FMOD may have changed some of it's function parameters.

If I were you, I'd open the FMOD documentation, look at the setFileSystem function, and see what parameters it takes. I'd also look at the sample code which comes with FMOD, and see what parameters it suggests passing to setFileSystem. Then, you should hopefully be able to fix the problem yourself.
Image
lordmonkey
Kobold
Posts: 27
Joined: Fri Mar 25, 2011 5:48 pm

Re: New FMOD SoundManager available in Wiki

Post by lordmonkey »

Ok so I get this 'working' (in setFileSystem() function I passed 0,0,0 as last 3 arguments (don't know if it's good but it's compiling) )

but now I load my sound with this soundManager and nothing gets played. problem is somewhere inside the PlaySound() function ( the program just go through it and no sound is played.

I also don't know if placing this code inside createScene function is good :

Code: Select all

	SoundManager *soundManagerPtr = new SoundManager;
	soundManagerPtr->Initialize();
	//
	int mySound1 = soundManagerPtr->CreateStream(Ogre::String("boing.wav") );
	int channel1 = 0;

              // This is wrong but should I attach it ??
	// headNode->attachObject(mySound1);

	soundManagerPtr->PlaySound(mySound1, headNode, &channel1);

	delete soundManagerPtr;
EDIT: I have the solution now.
The problem was that i called the

Code: Select all

delete soundManagerPtr;
just after contructing it and playing the sound therefore it did not have the chance to play the sound, Also I have heard on other forums that :
FMOD "playSound" is not a blocking operation, it will start playing the sound in another thread, then return.
Hope that it helps you guys with this problem

problem 2 :
I also had this problem :
My sound file was not loaded even though the ogre resource paths were set ok.
To fix this I change resource group in SoundManager.cpp from general to popular

Code: Select all

ResourceGroup* grp = getResourceGroup("General");// default General
now it looks like this

Code: Select all

ResourceGroup* grp = getResourceGroup("Popular");// default General
User avatar
capnramses
Kobold
Posts: 25
Joined: Thu Nov 04, 2010 11:06 am
Location: Dublin, Ireland
x 4

Re: New FMOD SoundManager available in Wiki

Post by capnramses »

I have just uploaded my audio wrapper library http://antongerdelan.net/projects/opens ... bwrapaudio. Feel free to try that. It supports the latest Fmod Ex as well as OpenAL 1.1. There is an example in there for both. And Makefiles for Windows, Linux, and OS/X.
It has a Creative Commons attribution-non-commercial-share alike licence, however.

<edit>changed the URL, above</edit>
Last edited by capnramses on Sun Jun 19, 2011 9:09 am, edited 1 time in total.
audiorausch
Gnoblar
Posts: 13
Joined: Sat May 28, 2011 5:13 pm

Re: New FMOD SoundManager available in Wiki

Post by audiorausch »

Is the FMOD SoundManager totally useless by now?
In SoundManager.cpp in the FrameStarted-method a function is called on a scenenode that doesn't even exist: listenerNode->getWorldPosition()

Does anybody have any suggestions what soundlibrary is easy to use with ogre? I just want to play a few sounds, nothing fancy...