First - thanks for Media. I had evaluated RunRev in the past, and now I'm back with another project idea that Media might be the fit for.
While playing back MP3's, can I script:
- the start and stop time of a Segment of an MP3
- the number of times to Loop the segment
?
Thanks.
Thanks for Media / MP3 playback question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
Hi Frank,
I don't really use mp3 much. You will need to check out whatever I say and perhaps adapt the code to get it work.
In the doc, you need to look under "play" (dictionary)
from the doc:
I don't really use mp3 much. You will need to check out whatever I say and perhaps adapt the code to get it work.
In the doc, you need to look under "play" (dictionary)
Code: Select all
play "/usr/local/clips/music.aiff" -- a file
play videoClip "Movie" at 100,100 -- an imported video clip
play audioClip "Trust No One" looping
if you kow how long it takes to make a single loop, then you can stop it after a given number of loops.If you use the play...looping form, the sound or video plays continuously from start to beginning until you stop it.
Code: Select all
send stopmovie to me in tmovietime seconds
on stopmovie
stop playing audioClip "my audio clip"
end stopmovie
Re: Thanks for Media / MP3 playback question
You can set the start and stop time on a Player object, which you use to play an mp3 file, using startTime, endTime, and playSelection. You may also need duration and timeScale to figure out the desired values for startTime and endTime.FrankR wrote:First - thanks for Media. I had evaluated RunRev in the past, and now I'm back with another project idea that Media might be the fit for.
While playing back MP3's, can I script:
- the start and stop time of a Segment of an MP3
- the number of times to Loop the segment
?
Thanks.
As far as looping only a number of times, I'm not sure there's an automated way to do it.
You could set up a handler on the player something like:
Code: Select all
on playStopped
set the cpTimesToPlay of me to the cpTimesToPlay of me - 1
if the cpTimesToPlay of me > zero then
set the currentTime of me to the startTime of me
start me
end if
end playStopped
Peter Evensen
[url]http://www.PetersRoadtoHealth.com[/url]
[url]http://www.PetersRoadtoHealth.com[/url]