Author Topic: Cutting Wav's off instead of playing them  (Read 10240 times)

Offline S. P. Gardebiter

  • Mr. Polyvector
  • ***
  • Posts: 247
    • View Profile
    • Tile 44 Interactive
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)
~ Cave Story rules! ~

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Cutting Wav's off instead of playing them
« Reply #1 on: 2008-Nov-11 »
Oh. Good idea. I'll think about it.
Maybe a STOPSOUND is required.

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
Re: Cutting Wav's off instead of playing them
« Reply #2 on: 2008-Dec-16 »
I too would like to see a STOPSOUND.

Offline Stu_C

  • Mc. Print
  • *
  • Posts: 34
    • View Profile
    • OvineByDesign
Re: Cutting Wav's off instead of playing them
« Reply #3 on: 2009-Aug-25 »

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


Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Cutting Wav's off instead of playing them
« Reply #4 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?

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
Re: Cutting Wav's off instead of playing them
« Reply #5 on: 2009-Aug-26 »
HUSH is a useful command to have, but sometimes you want to be able to stop an individual sound too.

MikeHart

  • Guest
Re: Cutting Wav's off instead of playing them
« Reply #6 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?

StuC_Ovine

  • Guest
Re: Cutting Wav's off instead of playing them
« Reply #7 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.


Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Cutting Wav's off instead of playing them
« Reply #8 on: 2009-Aug-26 »
do it yourself with ISSOUNDPLAYING()

MikeHart

  • Guest
Re: Cutting Wav's off instead of playing them
« Reply #9 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.

StuC_Ovine

  • Guest
Re: Cutting Wav's off instead of playing them
« Reply #10 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.


MikeHart

  • Guest
Re: Cutting Wav's off instead of playing them
« Reply #11 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.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1793
    • View Profile
    • Homepage
Re: Cutting Wav's off instead of playing them
« Reply #12 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.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Cutting Wav's off instead of playing them
« Reply #13 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.
« Last Edit: 2010-May-13 by Kitty Hello »