0
0

I am new to FMOD, i have read some exemple and tut and now i am trying to play an mp3 file .
The project compile with no error, except that when i ran the app, ther is no sound at all. I am using visual studio 2005,
Can any body help me… here is my code.

[code:2ocwy6et]
FMOD_RESULT result;
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel;

if (FMOD::System_Create(&system) != FMOD_OK) 
{
    std::cout<<"ERREUR::FMOD_System_Create(&system)" <<std::endl;
}

if (system->init(100, FMOD_INIT_NORMAL, 0) != FMOD_OK) 
{
    std::cout<<"FMOD_System_Init(system,100,FMOD_INIT_NORMAL,NULL)" <<std::endl;
}

result = system->createSound("Seine Saint Denis Style.mp3", FMOD_DEFAULT, 0, &sound);
if (result != FMOD_OK)
{
    printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
}


result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);

if (result != FMOD_OK)
{
    printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));        
}

[/code:2ocwy6et]

  • You must to post comments
0
0

Your code looks fine.

Can you hear sound when you run the playsound example? If so try loading the "Seine Saint Denis Style.mp3" file in the play sound example. If that doesn’t work it might be your file.

If the playsound example doesn’t work you might have a problem with the output mode. Have a look in the documentation (fmodex.chm) at the "Platform specific issues" / "Windows" for the recommended start up sequence, that might resolve your problem.

-Pete

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.