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 / Play Sound does not work as expected

Author
Message
Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 4th Dec 2005 22:24
Hi,

I feel pretty stupid right now. But somehow a simple .wav sound does not get played. Please see the code snipet. When I press the left mouse button on the title bar of the main window, then it will start playing the sound, though.

to make things more complex:
if I choose a music .wav file it will not play at all with dbPlaySound. dbPlayMusic does the job fine for that music .wav file.

So, do I need to have some (mouse) input to play a sound with dbPlaySound? How big should a sound file be? How high should be the bitrate? How can I get the chimes.wav file playing?

many thanks,
György
Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 5th Dec 2005 09:17
sorry. here is the code
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Dec 2005 15:04
Plays fine here when the escape key is pressed, and not when the title bar is clicked.

Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 5th Dec 2005 15:34
Hi, thanks so far. I have entered a Sleep(1000); before dbPlaySound() then it works. I think it is some timing issue here... before the system is ready to play the sound.

Could you tell me, please, if you know any restrictions concering soundfiles for dbPlaySound. I know they have to be .wav files.

A very big .wav file will not play with above code. Thanks anyway. Is there any guideline, when to use dbPlayMusic and when to use dbPlaySound...? I am going to code a game using a lot of sound snipets, maybe 50. But there will be only max. of 5-10 sounds being played at a time.

thanks from Germany, Gyoergy
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 5th Dec 2005 21:46
This may or may not be related to your problem, but I found that using dbSync caused all of my 3D sounds to be played in 2D (all panned to the centre). When I removed the dbSync and added my own timing code the problems went away. There's certainly some timing issue with sounds in the 1.1.1 version of the SDK.

Kaiyodo.
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Dec 2005 22:03
Shouldn't need a sleep command - worked for me without it.

Can you supply the very big file, and I'll see if I have trouble with it.

Login to post a reply

Server time is: 2024-05-07 03:13:48
Your offset time is: 2024-05-07 03:13:48