GLBasic forum

Feature request => music/sound => Topic started by: S. P. Gardebiter on 2008-Nov-10

Title: Cutting Wav's off instead of playing them
Post by: S. P. Gardebiter on 2008-Nov-10
I would be happy with a function that just cuts a wave off (if all channels are used) and starts playings it again. (instead of playing the full wave file and ignoring the playsound command)
Title: Re: Cutting Wav's off instead of playing them
Post by: Kitty Hello on 2008-Nov-11
Oh. Good idea. I'll think about it.
Maybe a STOPSOUND is required.
Title: Re: Cutting Wav's off instead of playing them
Post by: FutureCow on 2008-Dec-16
I too would like to see a STOPSOUND.
Title: Re: Cutting Wav's off instead of playing them
Post by: Stu_C on 2009-Aug-25

Sorry to reactivate this thread but I really could do with STOPSOUND too :)

Title: Re: Cutting Wav's off instead of playing them
Post by: Kitty Hello on 2009-Aug-26
It's on my TODO. I have implemented it already but not tested so far.
HUSH is a bit of overkill, right?
Title: Re: Cutting Wav's off instead of playing them
Post by: FutureCow on 2009-Aug-26
HUSH is a useful command to have, but sometimes you want to be able to stop an individual sound too.
Title: Re: Cutting Wav's off instead of playing them
Post by: MikeHart on 2009-Aug-26
Yes, I need a StopCommand in my game too as I need to stop sounds when a game object is leaving the scene.

Can you release the command with a big beta mark on it so we can test it?
Title: Re: Cutting Wav's off instead of playing them
Post by: StuC_Ovine on 2009-Aug-26

Yea HUSH is still needed but its nice to stop individual sounds.


Whilst your in there, is there a chance we can have a LOOP flag on the PLAYSOUND as we have in the PLAYMUSIC ? -  Its nice for ambient sounds so we can loop them but kill them off when not needed with the STOPSOUND.

Title: Re: Cutting Wav's off instead of playing them
Post by: Kitty Hello on 2009-Aug-26
do it yourself with ISSOUNDPLAYING()
Title: Re: Cutting Wav's off instead of playing them
Post by: MikeHart on 2009-Aug-26
do it yourself with ISSOUNDPLAYING()

Yes, you could that but depending on how much is going on in a frame it could lead to hearable gab between the end and the start of a sound.
Title: Re: Cutting Wav's off instead of playing them
Post by: StuC_Ovine on 2009-Aug-26

What he said ^  =D

Ive put a loop in but seeing that its not automatic there may be a slight silence when the loop is restarted manually.  Sounds ok whilst the game loop is so quick, but I'd imagine once theres a bit more going on then the looping sound will suffer from slight silence.

Title: Re: Cutting Wav's off instead of playing them
Post by: MikeHart on 2009-Aug-26
Like in my game AstroCrusher which I'm porting ot GLBasic; When the enemy appears, I have an short alarm sound going as long it is on the screen. And that sound needs looping.
Title: Re: Cutting Wav's off instead of playing them
Post by: Moru on 2009-Aug-26
It's still not possible to specify a starting position for a sound sample I guess? Start x seconds into the sound for example.
Title: Re: Cutting Wav's off instead of playing them
Post by: Kitty Hello on 2009-Aug-27
No, and I have no way to do the start at x, because I use SDL for many platforms and sound playback is quite limited on features there.
edit - cmd is in.