Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Music Playing Question?

Author
Message
Simfan147
15
Years of Service
User Offline
Joined: 13th Apr 2009
Location: My Computer Chair
Posted: 7th May 2009 03:38
I can't get it to work at all.




I don't know what is wrong.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 7th May 2009 03:50
Call dbLoopMusic() to play and loop and dbPlayMusic() to just play. I think the music resets itself to the beginning when dbPlayMusic() is called, so that might be your problem. Get rid of dbPlayMusic() in the code and tell me if it works.

#ifdef _DEBUG
FixBugs(All);
#endif
Simfan147
15
Years of Service
User Offline
Joined: 13th Apr 2009
Location: My Computer Chair
Posted: 7th May 2009 04:11
Ok, I just tried it but no go.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 7th May 2009 08:34
When you say you can not get it to work, are you saying that you can hear absolutely no music at all, as if the music file is not loading at all??????
Simfan147
15
Years of Service
User Offline
Joined: 13th Apr 2009
Location: My Computer Chair
Posted: 7th May 2009 22:13
Yes, I can't hear anything at all.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 8th May 2009 09:01
Call the dbLoopMusic outside the while (LoopGDK()), otherwise it will always reset to the beginning. Place it right after loading the music. Also, there is no path to your music file, just the file name. Are you sure the program finds and loads it at all? Try giving it a complete path, or a path relative to where the EXE is started from.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 8th May 2009 13:32 Edited at: 8th May 2009 13:36
Quote: "Yes, I can't hear anything at all. "


The thing to remember is when you are debugging your code, you are actually residing in the directory where your source code files (*.CPP,*.H, etc) happen to be situated in.

When you load your music file with the line "dbLoadMusic ("music_triumph.mp3",1);", your program will be expecting that sound file to be in the same folder as your source code.

If you temporarily put that sound file in the same spot as your source code files, then when debugging (F5 key within the IDE), your code should find that sound file.

ALSO,
change



To become


If you want the music to play only once and not loop, then you would uncomment the "dbPlayMusic (1);", and you would comment out the "dbLoopMusic (1);".

Login to post a reply

Server time is: 2024-10-01 01:22:44
Your offset time is: 2024-10-01 01:22:44