hi Vuo users,

how do i extract audio file position value? In video file player there is a timestamp output i can work with, but it seems it doesn't work like that with audio. what i need is a value of current position in miliseconds to make a progress bar in Lemur on iPad ( i already did one with video ).

Comments

Howdy, @IP. You're right,

jstrecker's picture
Submitted by

Howdy, Bogu. You're right, there is not currently an audio timestamp analogous to the video timestamp. An alternative way to make a progress bar would be to start a timer when you start playing the audio. The Measure Time node would be your timer, measuring the time elapsed, and the Get Audio File Info node would tell you the duration of the audio file.

Hi @IP

Bodysoulspirit's picture
Submitted by

Hi @IP

Made a small test based on Jaymie's technique cause I could make use of it too. I'm joining it here perhaps you'd make use of it.
However you'd have to add some cables for the pause case. Pause the audio should also pause the measured time.

Can't wait for proper Audio Timestamps too. I don't really understand this for example, with inf timestamp values

Ah ok yeah sorry I did not

Bodysoulspirit's picture
Submitted by

Ah ok yeah sorry I did not read that.

It's just that I don't really understand what all those audio frame nodes are for from their description + the fact that there are no sample compositions linked to them in the description.

I thought something like the image below would make a timeframe out of an audio, something like how long the audio is running, but it seems I'm completely wrong.

@Bodysoulspirit, I think your

jstrecker's picture
Submitted by

Bodysoulspirit, I think your confusion here originates from the fact that audio in Vuo doesn't (yet) have a timestamp like video does.

If you look at (click on) the Play Movie node's Decoded Video output port, the port popover shows that the data type is Video Frame. If you then search the Node Library for "Video Frame" and find the Make Video Frame and Get Video Frame Values nodes, you can infer that a Video Frame consists of an image and a timestamp. The Convert Frame to Timestamp (vuo.type.videoframe.real) node inputs a video frame and outputs its timestamp.

Now, if you look at the Play Audio File node's Decoded Channels output port, the data type is List of Audio Samples. The vuo.audio node set documentation explains the concept of Audio Samples, but the important thing to notice is that the data type is not Audio Frame. There's no timestamp here, it's just the audio.

A data type called Audio Frame does exist in Vuo. Looking at Make Audio Frame and Get Audio Frame Values, you can see that an Audio Frame consists of a List of Audio Samples and a timestamp.

When you use the Convert Audio to Frame node, it converts a List of Audio Samples to an Audio Frame and fills in its own value for the timestamp (see the node description). When you pass the created Audio Frame on to Convert Frame to Timestamp, it's just grabbing the timestamp that was put in by Convert Audio to Frame.

If you want a meaningful timestamp with audio, you have to calculate it yourself, e.g. using Measure Time.