Play sound and play stop
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Play sound and play stop
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?
Is there an easy way to stop playback of an MP3 on iOS?
Re: Play sound and play stop
Hi.
I have never played anything, but the dictionary does not list a "play stop" command. It does speak about a "stop" command:
I have never played anything, but the dictionary does not list a "play stop" command. It does speak about a "stop" command:
Craigstop [playing] {player | videoClip | audioClip}
Re: Play sound and play stop
Craig,
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".
No idea why it does not work as advertized? Maybe a bug?
What version are you using, Andy?
Best
Klaus
Code: Select all
play "path/to/file.mp3"
And "play stop" is the official way to stop this playback on iOS.
Look in the dictionary under "play".

No idea why it does not work as advertized? Maybe a bug?
What version are you using, Andy?
Best
Klaus
Re: Play sound and play stop
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.
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.
Re: Play sound and play stop
Klaus.
Aha, "under play".
Craig
Aha, "under play".
Craig
Re: Play sound and play stop
This IS in fact possible, but not with the simple PLAY command.andyh1234 wrote: ↑Mon Nov 25, 2024 7:54 pmHi,
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.
Look up "mobileControlCreate" (player) and "mobilecontrolget()" in the dictionary.
Re: Play sound and play stop
Can you share a specific example of how to use mobileControlCreate and mobileControlGet() to check the playback status and change the corresponding Play/Stop button on mobile devices?
-
- Posts: 683
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: Play sound and play stop
I'm not sure about the latest versions as I'm using old version (9.6.3) on an slightly older platform, but ...
I recommend the mobilePlayer control for media play back on mobile, works well on Android as well.
But if you do still want to use 'play' command then try it with its AC/VC audioClip/videoClip form:
play VC tPathToMyMp3File
that worked for me on Android with mp3 (and even with MIDI files on Android)
Do NOT try to use regular play tFile version of the command with an mp3 file on recent macOS, it will probably make a horrible screeching noise with no way to 'play stop' (nor does play "stop" work) with that command on macOS, I assume it did work properly at one time (probably used QuickTime 'under the hood'). I'm not sure if 'Play empty' works as a workaround on macOS. You can see new posix process IDs are created for each playing file and if you 'kill pID' those newly created processes screeching will stop, so thats one way to stop a wild play command.
I recommend the mobilePlayer control for media play back on mobile, works well on Android as well.
But if you do still want to use 'play' command then try it with its AC/VC audioClip/videoClip form:
play VC tPathToMyMp3File
that worked for me on Android with mp3 (and even with MIDI files on Android)
Do NOT try to use regular play tFile version of the command with an mp3 file on recent macOS, it will probably make a horrible screeching noise with no way to 'play stop' (nor does play "stop" work) with that command on macOS, I assume it did work properly at one time (probably used QuickTime 'under the hood'). I'm not sure if 'Play empty' works as a workaround on macOS. You can see new posix process IDs are created for each playing file and if you 'kill pID' those newly created processes screeching will stop, so thats one way to stop a wild play command.