play vs. start

J. Landman Gay jacque at hyperactivesw.com
Wed Jan 17 15:29:01 EST 2007


Phil Davis wrote:
> I still need the info, so...
> 
> I maintain an application that sometimes plays 100's of external digital 
> audio
> files during a single usage session. Currently the app uses 'start player'
> method of playing them. Sometimes the app will freeze up, and I think it's
> related to audio processing.
> 
> I want to improve the app's stability. Has anyone found the 'play 
> [filepath]'
> form to be more stable or less stable than 'start player'?

I haven't had problems with either one, so I can't really say.

> 
> Also, does anyone have extra info about the two approaches to audio 
> playing that
> shed light on differences between the two? Are they doing the exact same 
> thing
> under the hood?
>

They are different under the hood. Player objects use QuickTime or, if 
it isn't available, WMP on Windows. The "play" command uses internal 
libraries that are, I think, fairly dated now. The MC docs say that 
"play" is deprecated and all new stacks should use player objects 
instead -- however, as I said, I haven't had any problems with the play 
command. I don't usually ask much of it though.

The play command is far more limited than a player object. Basically you 
can start, stop, and pause an audio file. It will only play a subset of 
audio file formats, basically only those that are not compressed in any 
way, and which are saved at only a few specific sample rates. You can't 
start playback at an arbitrary point, only at the beginning.

I've used "play" for short sound segments, especially those I want to 
embed in a stack (like sound effects) but I don't use it for anything 
elaborate. I think you said you were using mp3 files, right? If so, 
"play" probably isn't an option as I don't believe it will work with 
that file format anyway.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list