[Implemented] IsPlaying ( #Sound )

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
HeX0R
Addict
Addict
Posts: 1187
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

[Implemented] IsPlaying ( #Sound )

Post by HeX0R »

This would be very handy for checking if a sound is still playing.
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: IsPlaying ( #Sound )

Post by luis »

HeX0R wrote:This would be very handy for checking if a sound is still playing.
+1

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!

:)
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Post by luis »

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() ?
zikitrake
Addict
Addict
Posts: 868
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Post by zikitrake »

8) Someone with a solution for IsPlaying(#IdSound)?

Thank you!

--- EDITED & SOLVED :) ---

http://www.purebasic.fr/english/viewtopic.php?t=30023
PB 6.21 beta, PureVision User
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: IsPlaying ( #Sound )

Post by jamirokwai »

HeX0R wrote:This would be very handy for checking if a sound is still playing.
+1 :-)

A callback-function when Sound has stopped would be great!
Regards,
JamiroKwai
User avatar
Pforzheimer
User
User
Posts: 21
Joined: Thu Sep 25, 2008 7:12 am
Location: Germany
Contact:

Re: IsPlaying ( #Sound )

Post by Pforzheimer »

HeX0R wrote:This would be very handy for checking if a sound is still playing.
+1

This would be very handy for me too :D
Still awaiting real brain interface for computers :-)
[REGISTERED PB OWNER since 2008] [Wind0ws + LINUX]
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: IsPlaying ( #Sound )

Post by blueznl »

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... )
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: IsPlaying ( #Sound )

Post by DoubleDutch »

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
Post Reply