0
0

I have the problem to play a MIDI file.
The following is my simple program compiled by VC++.

===

include “fmod.hpp”

main()
{
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel;

FMOD::System_Create(&system);
system->init(32,16,(FMOD_INITFLAGS)(FMOD_INIT_NORMAL),NULL);
system->createSound(“a.mid”,FMOD_HARDWARE,0,&sound);
system->playSound(FMOD_CHANNEL_FREE,sound,false,&channel);
Sleep(60000);
channel->stop();
sound->release();
system->close();
system->release();

}

If I trace the above program, “Unhandled exception in …: Access Violation” message popped up when invoking system->createSound(..).

When I replace a MIDI file with a wave or mp3 file, it works well.

Please let me know what is wrong with my code.

  • You must to post comments
0
0

The same error occurred when trying createStream().

  • You must to post comments
0
0

First I unzipped fmodapi40023win.zip file.
Secondly I copied canyon.mid file into fmodapi40023win\examples\media folder.
Then, I opened the fmodapi40023win\examples\playstream\main.cpp file, replaced the line of “result=system->createStream(“../media/wave.mp3”, …) with the line of “result=system->createStream(“../media/canyon.mid”,…), and rebuild it using Win32 Debug CPP configuration.

But it failed to play the canyon.mid and the same error message popped up. The same situation when trying the same thing in playsound example folder.

  • You must to post comments
0
0

Thanks a lot!

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.