Replicating UMP time markers

Topics related to using ToolBook for building web apps.

Re: Replicating UMP time markers

Postby Geoff Pearson » Mon Jan 25, 2016 10:04 pm

Another question!!

In AE, how do I query the status of an audio clip?

For example, I am trying to replace...

if mediaplaying of group "shutdown"
Stop media player UMP "shutdown"

I now have the mp3 clip "shutdown" playing using the PPac pgSoundControl but haven't figured out how to determine its status.

Geoff Pearson
Geoff Pearson
 
Posts: 14
Joined: Sun Jan 19, 2014 11:08 pm

Re: Replicating UMP time markers

Postby Clifton » Tue Jan 26, 2016 12:11 am

pgSoundControl() is the companion function to pgSoundLoader(). It allows you to set/get the playhead position and the status of any audio loaded with pgSoundLoader(). The popup help provides all the details to help you set up your audio queries. If you are getting a property of an audio, you must set a variable to store the return value from the function and then check the returned value to determine how your Actions should handle the result.

There are several ways to get the status of an audio using pgSoundControl().
  1. Set action =
    "status"

    Returns undefined or 0 for audio that is not playing and 1 for an audio that is playing. Other possible values indicated in the popup help are 2 or 3, but very rarely are these ever returned.
  2. Set action =
    "isPaused"

    Returns true (paused) or false (or playing)
Example:
    Image 2.png
    GET STATUS of audio named "myAudio"
    Image 2.png (49.78 KiB) Viewed 3829 times

    When this button is clicked without loading
    "myAudio"
    first, it displays the alert string "undefined" which is the same as 0 or false.
    When the
    "myAudio"
    is playing or paused, it returns 1 indicating the audio is loaded and available for manipulation by pgSoundControl().
    When the
    "myAudio"
    has finished playing, it returns 0.
    I prefer to catch the "end" value in the on user event if that is all that is needed. Otherwise check the
    isPaused
    property.
Of course, pgSoundControl() can remotely get/set playhead position, get/set volume too, unload audio files, toggle the pause/play state, stop/resume, etc. It's all in the popup documentation.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Previous

Return to Web (DHTML) Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron