Source language: Translate to:

Controling audio file position

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Controling audio file position

Postby carlos torres » Mon Sep 16, 2013 10:45 am

Dear NB Team


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?

User avatar
carlos torres
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Re: Controling audio file position

Postby Neosoft Support » Mon Sep 16, 2013 10:59 am

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"
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5621
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest