Playing a sound

J. Landman Gay jacque at
Fri Dec 13 13:53:51 EST 2013

On 12/12/13 4:30 PM, Graham Samuel wrote:
> After all these years, this is another very naive question, but if I
> create a player object which points to a sound file say 30 seconds
> long, and execute
> start player "myVoiceRecording"
> the player does start, but it stops again after a second or two. I
> can't find anything in the usual sources to explain how to let the
> thing simply run until the end, as one can by clicking on the
> controller if it was showing (it isn't). I think maybe it's because
> the script runs on after I start the controller and eventually
> switches cards, which apparently (not documented AFAIKS) stops the
> sound.

Actually it's a glitch in the player, I ran into it a while ago. I think 
it was Trevor who suggested I use "set the playrate of player x to 1" 
instead of "start player x". That fixed it.

In my case I also had callbacks assigned to the player and setting the 
playrate didn't trigger those, so I had to use both:

start player x -- sets up the callbacks
set the playrate of player x to 1 -- plays the whole sound

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list