Page 1 of 1

Controling audio file position

PostPosted: Mon Sep 16, 2013 10:45 am
by carlos torres
Dear NB Team

TIA

How can I get the position in an audio file using your neoDX?
I'm trying this in a button
Code: Select all
dxPlaySoundFile "[PubDir]Audio\Interview.mp3" "NORMAL"
dxCreate "rAudio" "[IDPlayer]" ""
TrackBarSetMax "PosBarAudio" "[IDPlayer.Length]"
dxSetPosition "[IDPlayer]" "[IdPlayer.Position]" "Milliseconds"


And within the trackbar in the Value Changed section
Code: Select all
dxSetPosition "[IDPlayer]" "[IDPlayer.Position]" "Milliseconds"


I'm missing something?

regards,
carlost

Re: Controling audio file position

PostPosted: Mon Sep 16, 2013 10:59 am
by Neosoft Support
You can't do that with dxPlaySoundFile. Instead you need to do something like this:

dxCreate "Rectangle1" "[Player1]" ""
dxOpenFile "[Player1]" "[PubDir]Audio\Interview.mp3"
TrackBarSetMax "PosBarAudio" "[Player1.Length]"

To play the audio:

dxPlay "[Player1]" "1"

In the track bar's ValueChanged action (assuming that the track bar's variable is set to [Player1.Position]):

dxSetPosition "[Player1]" "[Player1.Position]" "Milliseconds"