Page 1 of 1
Play sound and play stop
Posted: Mon Nov 25, 2024 4:32 pm
by andyh1234
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?
Re: Play sound and play stop
Posted: Mon Nov 25, 2024 7:02 pm
by dunbarx
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
Re: Play sound and play stop
Posted: Mon Nov 25, 2024 7:10 pm
by Klaus
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
Re: Play sound and play stop
Posted: Mon Nov 25, 2024 7:54 pm
by andyh1234
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.
Re: Play sound and play stop
Posted: Mon Nov 25, 2024 7:55 pm
by dunbarx
Klaus.
Aha, "under play".
Craig
Re: Play sound and play stop
Posted: Mon Nov 25, 2024 11:19 pm
by Klaus
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.
Re: Play sound and play stop
Posted: Thu May 15, 2025 4:14 am
by Sophiasm
Klaus wrote: ↑Mon Nov 25, 2024 11:19 pm
This IS in fact possible, but not with the simple PLAY command.
Look up "mobileControlCreate" (player) and "mobilecontrolget()" in the dictionary.
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?
Re: Play sound and play stop
Posted: Fri May 16, 2025 12:17 am
by PaulDaMacMan
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.