0
0

hello,

I now succesfull played a song with the basic example. Now I want to ‘port’ it to my graphical QT program. But when I do that the system freezes (with the same code as i used for the ‘DOS’ player)

what i have inside a method, who’s actived when clicked on a button:

FMOD_SYSTEM *system;
FMOD_SOUND *sound;
FMOD_CHANNEL *channel = 0;
FMOD_RESULT result;
int key;
unsigned int version;

result = FMOD_System_Create(&system);
result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL);
result = FMOD_System_CreateStream(system, "mylo.mp3", FMOD_HARDWARE | FMOD_LOOP_NORMAL | FMOD_2D, 0, &sound);
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel);



do
{


    FMOD_System_Update(system);


    Sleep(10);

} 
while (key != 27);

No I think, it has to be in a thread or something? I think because the do/while. Do i have to put it in a thread or can i play a song without the do/while? If i remove the whole do while thing the program (inDOS) doesn’t start.

And about System::update, it has to be called once per frame. But i can’t find anywhere how long a frame takes?

Thnx for everyone for answering this newbie 😉

nh

  • You must to post comments
0
0

So, when i use this (see below) there is no sound when the button is pushed:

FMOD_SYSTEM *system;
FMOD_SOUND *sound;
FMOD_CHANNEL *channel;
FMOD_RESULT result;
result = FMOD_System_Create(&system);
result = FMOD_System_Init(system, 100, FMOD_INIT_NORMAL, NULL);
result = FMOD_System_CreateStream(system, “mylo.mp3”, FMOD_SOFTWARE, 0, &sound);
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, &channel);

I do’nt understand because i used the same example like in the tutorial. And like i said, using de playstream example let my system freeze in a graphical environnement.

thnx,
nh

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.