[Implemented] IsPlaying ( #Sound )
[Implemented] IsPlaying ( #Sound )
This would be very handy for checking if a sound is still playing.
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: IsPlaying ( #Sound )
+1HeX0R wrote:This would be very handy for checking if a sound is still playing.
It would be nice to concatenate more than one sound for example.
There are ways, but should be nice to have a cross platform solution.
Use timers and calculate the duration of every sound loaded is not exactly fun!

An addendum:
the current play function is
Result = PlaySound(#Sound [, Flags])
Would be nice to have, as second parameter before the optional flags, a pointer to a function to be used as callback.
If null (0), no callback, if > 0 the then it would be the address of the function to be called when the sound has been completely played. In the case of looping, the callback should be called after any loop.
Don't know if feasible, but would be nice if the callback function could receive the channel number originally returned in "Result". In this way would be possible to use a single callback to process more the one sound.
Something like that anyway, to facilitate the concatenation of sounds and avoid (in some cases) the need to ask many times IsPlaying() ?
the current play function is
Result = PlaySound(#Sound [, Flags])
Would be nice to have, as second parameter before the optional flags, a pointer to a function to be used as callback.
If null (0), no callback, if > 0 the then it would be the address of the function to be called when the sound has been completely played. In the case of looping, the callback should be called after any loop.
Don't know if feasible, but would be nice if the callback function could receive the channel number originally returned in "Result". In this way would be possible to use a single callback to process more the one sound.
Something like that anyway, to facilitate the concatenation of sounds and avoid (in some cases) the need to ask many times IsPlaying() ?

Thank you!
--- EDITED & SOLVED

http://www.purebasic.fr/english/viewtopic.php?t=30023
PB 6.21 beta, PureVision User
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: IsPlaying ( #Sound )
+1HeX0R wrote:This would be very handy for checking if a sound is still playing.

A callback-function when Sound has stopped would be great!
Regards,
JamiroKwai
JamiroKwai
- Pforzheimer
- User
- Posts: 21
- Joined: Thu Sep 25, 2008 7:12 am
- Location: Germany
- Contact:
Re: IsPlaying ( #Sound )
+1HeX0R wrote:This would be very handy for checking if a sound is still playing.
This would be very handy for me too

Still awaiting real brain interface for computers 
[REGISTERED PB OWNER since 2008] [Wind0ws + LINUX]

[REGISTERED PB OWNER since 2008] [Wind0ws + LINUX]
Re: IsPlaying ( #Sound )
That is an age old request, I vaguely remember requesting the same thing too... so another +1 

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: IsPlaying ( #Sound )
I've just found this problem too. IsPlaying() would be great (as would the callback system).
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system