[fpc-pascal] Re: Playing sounds with standard components
graemeg.lists at gmail.com
Wed Jun 13 12:08:56 CEST 2012
On 13 June 2012 04:26, silvioprog <silvioprog at gmail.com> wrote:
> I tried playing a wav file with this demo in attached, no errors, but
> no sound came out. :(
You are releasing the TSoundEngine instance to quickly, and don't give
SDL chance to initialize fully and play the sound. Simply add a
sleep(1000) call [just for demonstration purposes] after you called
PlayingStart(), then you will hear the sound.
A better idea would be to change your code as the attached unit. Keep
the TSoundEngine instance in the form (or as a global variable), so
then playing any sounds are instant.
- Graeme -
fpGUI - a cross-platform Free Pascal GUI toolkit
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2362 bytes
Desc: not available
More information about the fpc-pascal