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 / how to play a song (mp3) in dark gdk

Author
Message
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 16th Jan 2009 22:40 Edited at: 22nd Jan 2009 18:40
Ok, I have what should be a simple problem. BTW I have read many a forum on this issue and either I don't get it or they didn't apply to my case. the rest of the code compiles just fine and the Music file "strawberry.mp3" is within the project, FYI.


If you're not livin', you're already dead!
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 17th Jan 2009 08:12
Try this.



When setting the volume, you don't need to specify the music ID. I think because you can only play one music file at a time. Also, a volume level of 8 is barely hearable. 100 is the max setting, 50 is half. So a volume setting of 8 is way too quiet I'm guessing.

www.Helios-Online.net
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 17th Jan 2009 09:14
So I had figured ot the volume already, I got that set to a hundred, however my compiler tells me dbsetmusicvolume does not take 1 argument, I believe it needs two, so I'm still stuck, and still need help, but thanks for the advice, I've also tried playing the music in my LoopGDK area to no avail.

If you're not livin', you're already dead!
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 17th Jan 2009 18:34
Ugh, I'm so sorry, it was late last night ha ha. I would test this myself, but my sound card drivers haven't been installed yet.

Try with this code:


You actually may not even need to set the volume, its max by default? But anyway, I was looking at the wrong command for volume in the documentation. But dbLoopMusic and dbPlayMusic do the same thing. You only need one, you either want to play it once, or loop it. Not both at the same time ha ha.

www.Helios-Online.net
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 17th Jan 2009 20:41
Twas as I feared, this also does not work, I was researching last last and read someones post that the mp3 player in Dark gdk may be a glitch, that it doesnt work, they suggested loading it as a sound and changing it to a wav. file, I would think that if it was a bug, someone could fix it and provide a patch, or at least be very upfront about it, if its not a bug then that's even better, I got a lot of good info from a website called www.johnspink.net on the commands in gdk. but I would think that this website would have that somewhere. Also when I rea a forum and try to go back a page it says the page is lost or something and I have to re-click it in my favorites and search again. It seems like the Html for this site could improve just a hair. However I'm just a beginner at all this, but I know what its like to try to run an empire, and not everything is always perfect.

If you're not livin', you're already dead!
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 19th Jan 2009 03:55
Well, i'd still like to hear if any1 knows for sure if the music function works or not, if not does any1 no if someone has a patch?

If you're not livin', you're already dead!
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 20th Jan 2009 10:52
Do you have a path issue if the file cannot be found it wont get played.

Try this make a folder "c:/media/"
put your music file in it and then
dbLoadMusic("C:/media/myfilename.mp3",1);
If that plays you have to sort out your path stuff for files.
Hope thats useful to you it helped me find out i had a path problem
it would not play anything until i realised that......

Regards :- Steve
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th Jan 2009 11:06
Quote: "Also when I read a forum and try to go back a page it says the page is lost or something and I have to re-click it in my favorites and search again."


When you look at a post after doing a search, right click and open it in a new tab, that way you dont lose your search results.
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 21st Jan 2009 20:56 Edited at: 22nd Jan 2009 18:42
Ok sorry about all this, I finally got it, I had pasted the file into my solution window but what I really needed to do was put it in the Terrain tutorial project file. the other way it looks like its in the project but it actually isn't for some reason. Thanks peeps. Also thanks for the new tab tip, sometimes answers are as plain as the nose on our face.

If you're not livin', you're already dead!
Comnik
15
Years of Service
User Offline
Joined: 16th Feb 2009
Location:
Posted: 16th Feb 2009 20:22
Im Sorry,
but I thought it has to be:


So replace Music with Sound, I wonder why It works with Music...

Login to post a reply

Server time is: 2024-11-25 11:22:22
Your offset time is: 2024-11-25 11:22:22