[Gambas-user] Sound SDL

Benoit Minisini gambas at ...1...
Sun May 30 09:23:25 CEST 2004


On Wednesday 26 May 2004 07:22, Devilyn wrote:
> Ok got SDL up and running in Gambas. But I do not know
> what commands to use... I only plan on using WAV files
> for my game program. Can someone post some demo code
> on how to play a WAV file using the Sound Componet.
> Maybe how to start 1 wav and loop it or stop the wav
> from playing... then I assume you just do the same to
> play more than one at a time?
> Little help?
>  Dev
>

DIM hChannel AS Channel
DIM hSound AS Sound

hSound = NEW Sound("/path/to/mysound.wav")
hChannel = hSound.Play(8) ' Plays 8 times. If you use -1, the sound is played 
infinitely.
...
hChannel.Stop ' Stop the sound played on this channel.

Is it a bit clearer ?

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list