Play sound and play stop

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andyh1234
Posts: 471
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Play sound and play stop

Post by andyh1234 » Mon Nov 25, 2024 4:32 pm

I'm using the play command to play a sound filled successfully on iOS, works great but issuing play stop does not stop playback.

Is there an easy way to stop playback of an MP3 on iOS?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10055
Joined: Wed May 06, 2009 2:28 pm

Re: Play sound and play stop

Post by dunbarx » Mon Nov 25, 2024 7:02 pm

Hi.

I have never played anything, but the dictionary does not list a "play stop" command. It does speak about a "stop" command:
stop [playing] {player | videoClip | audioClip}
Craig

Klaus
Posts: 14016
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Play sound and play stop

Post by Klaus » Mon Nov 25, 2024 7:10 pm

Craig,

Code: Select all

play "path/to/file.mp3"
is one possible and official way to PLAY a file on iOS.
And "play stop" is the official way to stop this playback on iOS.
Look in the dictionary under "play". 8)

No idea why it does not work as advertized? Maybe a bug?
What version are you using, Andy?


Best

Klaus

andyh1234
Posts: 471
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Play sound and play stop

Post by andyh1234 » Mon Nov 25, 2024 7:54 pm

Hi,

Ive founf a solution, simply

play empty

stops the playback.

It would be great if there was a way to know if something is currently playing so I could swap the play button for a stop button and have that automatically flip back to a play button at the end of the playback but it looks like this is not possible yet on mobile devices.

Thanks for the help.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10055
Joined: Wed May 06, 2009 2:28 pm

Re: Play sound and play stop

Post by dunbarx » Mon Nov 25, 2024 7:55 pm

Klaus.

Aha, "under play".

Craig

Klaus
Posts: 14016
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Play sound and play stop

Post by Klaus » Mon Nov 25, 2024 11:19 pm

andyh1234 wrote:
Mon Nov 25, 2024 7:54 pm
Hi,

Ive founf a solution, simply
play empty
stops the playback.

It would be great if there was a way to know if something is currently playing so I could swap the play button for a stop button and have that automatically flip back to a play button at the end of the playback but it looks like this is not possible yet on mobile devices.

Thanks for the help.
This IS in fact possible, but not with the simple PLAY command.
Look up "mobileControlCreate" (player) and "mobilecontrolget()" in the dictionary.

Post Reply

Return to “iOS Deployment”