Archived

This topic is now archived and is closed to further replies.

Audio in SDL

This topic is 5742 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using the audio example in the book "Programming linux games" and the sound is delayed 1/4''th of a second! my only problem with tis is when i try to loop a sound it is delayed 1/4''th of a second and doesnt sound right!

Share this post


Link to post
Share on other sites
You are lucky, I tried the same example yesterday and ..I don''t even have any sound at all .
I compiled the source code directly without using the makefile included with the downloaded sources and the gcc compiler didn''t return any error.When I run the executable it confirms that the canon and bomb wavefiles have been loaded successfully but it sounds like the gunpowder is...wet.
I know my Soundblaster live works OK because I have sound while playing Tuxracer and Unreal tournament.

Cone3D''s reply doesn''t help either
Maybe I should try to compiles all the sources at once using the included makefile.

Share this post


Link to post
Share on other sites
Well, i''m using a modified version of the SDL Audio Mixer example in SDL Documentation. When i got sound latency, it was gone by decreasing sound buffer.


--blue4--

Share this post


Link to post
Share on other sites
2 things:
1) I compiled the example from the book using the included makefile and it works, and I was surprised to hear that the same file i compiled directly from source ( using the gcc command works too ) it looks like just rebooting the system did the trick.
It''s true that there is a small latency before hearing the sound of the explosion.
Obviously, as specified in the SDL doc and as suggested by Blue4 the trick is to decrease the value of desired.samples
The documentation suggests values between 512 and 8192
The example uses 4096 so maybe we should try 2048 or 1024

To Blue4:
What value are you using for desired.sample ?

Share this post


Link to post
Share on other sites