Page 1 of 1

Audio Clip remaining time

Posted: 16 Mar 2018, 18:44
by Total-Image
With the duration and position properties of the movie clip node I can calculate the exact remaining time of a movie clip, but since the audio clip node doesn't have a position property (only a duration), I'm looking for a solution to get the exact remaining time of a audio clip.
As a temporary solution I added a Timer node to the scene.
Bind the duration of the audio clip to the Start time property of the Timer node and created a event which triggers both the Timer Start and Audio clip play event simultaneously.
The problem we've is that in certain situations the Timer is elapsed earlier then the Audio clip.
I'm not sure if this has something to do with the enable audio compensation option (which is in our case off) or with the clock mode or sample rate of the sound card (RME fireface in our case) or with something else?
The audio files are most of the time *.mp3 files.
Maybe the animation node is a solution, but we don't know which audio file we've to play back in advance.

Kind regards,

Rogier

Re: Audio Clip remaining time

Posted: 22 Mar 2018, 16:45
by sribas
i think, for now, binding a timer is the only way (maybe with C# you can bypass it).
To avoid your timer to end before/after your audio, you should connect your audio duration to your StartTime

Re: Audio Clip remaining time

Posted: 25 Mar 2018, 07:11
by Agalar Ragimov
Total-Image wrote:With the duration and position properties of the movie clip node I can calculate the exact remaining time of a movie clip, but since the audio clip node doesn't have a position property (only a duration), I'm looking for a solution to get the exact remaining time of a audio clip.
As a temporary solution I added a Timer node to the scene.
Bind the duration of the audio clip to the Start time property of the Timer node and created a event which triggers both the Timer Start and Audio clip play event simultaneously.
The problem we've is that in certain situations the Timer is elapsed earlier then the Audio clip.
I'm not sure if this has something to do with the enable audio compensation option (which is in our case off) or with the clock mode or sample rate of the sound card (RME fireface in our case) or with something else?
The audio files are most of the time *.mp3 files.
Maybe the animation node is a solution, but we don't know which audio file we've to play back in advance.

Kind regards,

Rogier
Hi Rogier,
Animation node could be a solution for your question.
Check the image below.
The number '6000' I took just as an example. You can take any number but it should be much bigger than the 'duration time' of the longest audio file you can get from the client.

P.S. If you found out a better solution, please share.

Re: Audio Clip remaining time

Posted: 26 Mar 2018, 21:41
by Total-Image
I found a solution by using the DateTime node and bind the "seconds" property to a "variable" node. The "changed" event of the "variable" node triggers the "forward" (or backward) property of a "counter" node and the "start" (or end) value to the duration of the audio clip node..... See attachment

Re: Audio Clip remaining time

Posted: 27 Mar 2018, 07:10
by Agalar Ragimov
Total-Image wrote:I found a solution by using the DateTime node and bind the "seconds" property to a "variable" node. The "changed" event of the "variable" node triggers the "forward" (or backward) property of a "counter" node and the "start" (or end) value to the duration of the audio clip node..... See attachment
I like it. Good and simple solution.
Image