Hi everyone. As I’ve said I’m new at this but I’m pretty sure I did this right… or nearly correct.
Here is the code.
// 3D test try two ok.cpp : Defines the entry point for the console application.
int main(int argc, _TCHAR* argv)
printf("PLEASE PLAY DANG IT!");
FMOD::System_Create(&Test); // Create the main system object. Test->init(100, FMOD_INIT_NORMAL, 0); FMOD::Sound *drums; result = Test->createSound ("dreamhats2.wav", FMOD_DEFAULT, 0, &drums); result = drums->setMode(FMOD_LOOP_NORMAL); FMOD::Channel *source; result = Test->playSound(FMOD_CHANNEL_FREE, drums, 0, 0); while (!kbhit()) Test -> update(); return 0;
I had to take out the ereror checks because they kept causing other problems. Do I need those for this to work.
I’m using Visual Studio 2008.
As you can see, I’ve included all the proper headers and put the fmodex.dll in the source file folder. The dreamhats2.wav sample is also in the Source file folder.
That didn’t work, so I moved the sound and dll to the debug folder… that didn’t work.
I’m not sure why the sound won’t play. The box appears, the text shows up, there are no errors saying that visual does not recignize something in the fmod sections of code, but it still will not play.
I will mess with some examples and try replacing the sound files in those.
On a side note, I changed the name of the system in the 3d example and I replaced some of the sounds and changed the text, but when I recompiled it, nothing changed and the box opened and closed really quickly. This may be a different problem. The main one is the problem mentioned above.
Any ideas? Thanks.[/code]
- Dreamcube017 asked 7 years ago
FMOD is a multi-threaded library, so if you keep calling update without a sleep, the main thread will be spending a lot of time holding a lock on the critical sections, which could be preventing the other threads from operating properly. To remedy this you can try adding a sleep:
Test -> update();
[quote:11giwo64]As you can see, I’ve included all the proper headers and put the fmodex.dll in the source file folder. The dreamhats2.wav sample is also in the Source file folder. [/quote:11giwo64]
Are you linking to the FMOD library?
if not go to [b:11giwo64]Project Properties[/b:11giwo64] -> [b:11giwo64]linker[/b:11giwo64] -> [b:11giwo64]input[/b:11giwo64] -> [b:11giwo64]Additional Dependencies[/b:11giwo64]
Add the following:[i:11giwo64] fmodex_vc.lib[/i:11giwo64]
I would expect this to cause linker errors so that’s probably not the problem.
[quote:11giwo64]I changed the name of the system in the 3d example and I replaced some of the sounds and changed the text, but when I recompiled it, nothing changed and the box opened and closed really quickly[/quote:11giwo64]
The ERRCHECK function in the examples exits the program when there is an error. If you put a break point on this line it will break before it exits and you can see what error you’re getting. In this case it could be a file not found error.
Ok thanks. I’ll try this out.
The update was just added today but it didn’t work before either.
I don’t know if I linked the fmodex_vc.lib correctly as it shows up in bold so I’m not sure.
I’ll keep trying.
With the 3D example, I am not sure if I pointeid to the wrong file or place but I’m pretty sure I put the entire file path in quotes so there’s no way it could get it wrong. I made sure that when I changed the system name (to riblet because I was bored), but I made sure I changed the name of all the places where system-> and thigns like that shows up.
I’ll mess with it some more. But thank you for replying.
- Dreamcube017 answered 7 years ago
[quote:hs3d8ycx]I am not sure if I pointeid to the wrong file or place but I’m pretty sure I put the entire file path in quotes so there’s no way it could get it wrong.[/quote:hs3d8ycx]
It can be identical to what is shown in explorer and still be wrong. If you’re using backslashes you need two in a row "\" otherwise it indicates a special character like "\n" is a new line.
Please login first to submit.