• Print

Author Topic: How to: Program stops until soundplay ends  (Read 92 times)

MrFreyer

  • Newbie
  • *
  • Posts: 26
How to: Program stops until soundplay ends
« on: April 09, 2013, 01:42:29 AM »
Hallo,

how does it works, that the program stops until a soundfile is completely played with _SNDPLAY?

for example:

_SNDPLAY example&

(-> program will wait until soundplay ends)

SYSTEM

Thanks for the help  :)


EDIT:

Think, I've found a solution... _SNDPLAYING
« Last Edit: April 09, 2013, 01:49:30 AM by MrFreyer »

Mrwhy

  • Hero Member
  • *****
  • Posts: 2890
  • My Dad called me Mr Why when I was 5.
    • Email
Re: How to: Program stops until soundplay ends
« Reply #1 on: April 09, 2013, 02:43:36 AM »
Soundplay starts to play when its storage buffer is near empty (e.g half a second).
Then it accepts further addition into that buffer and plays everything until there is no more to play.

fluffrabbit

  • Sr. Member
  • ****
  • Posts: 393
Re: How to: Program stops until soundplay ends
« Reply #2 on: April 09, 2013, 07:49:41 AM »
I see you figured it out. For everyone else:

Code: [Select]
loudscream&=_SNDOPEN("loudscream.wav")
_SNDPLAY loudscream&
DO
    _DELAY 0.05
LOOP UNTIL NOT _SNDPLAYING(loudscream&)
SYSTEM

  • Print