Audio.GetCurrentPos

Hi all,

First, I want to thanks the maker of this software. :wub:

I use the free version of this powerful software.I’ve read Api documents but in the audio functions, following function could not find :

Audio.GetCurrentPos

This function is very useful and I need it.How can I use this function in Corona?

Hi @psmohsen,

Can you describe in more detail what you want to do? For example, do you want to begin playing an audio effect/stream, and then later, determine how long (how many seconds) it has been playing?

Brent

Audio.GetCurrentPos Function Description: Retrieves the current time position of an audio channel, in seconds.

Yes I need a function to do this.

for Example :

position = Audio.GetCurrentPos(2);

Stores the current position of the audio in channel 2 in a variable named “position.”

Hi @psmohsen,

There is not an API that does this, however, you can check the (system) time when you begin playing the audio file, and then when you need to check how much time has elapsed, check the system time again and compare it to the start time.

Best regards,

Brent

Thanks But it’s hard. :frowning: Please add this api function in the next version.

Hi @psmohsen,

Can you describe in more detail what you want to do? For example, do you want to begin playing an audio effect/stream, and then later, determine how long (how many seconds) it has been playing?

Brent

Audio.GetCurrentPos Function Description: Retrieves the current time position of an audio channel, in seconds.

Yes I need a function to do this.

for Example :

position = Audio.GetCurrentPos(2);

Stores the current position of the audio in channel 2 in a variable named “position.”

Hi @psmohsen,

There is not an API that does this, however, you can check the (system) time when you begin playing the audio file, and then when you need to check how much time has elapsed, check the system time again and compare it to the start time.

Best regards,

Brent

Thanks But it’s hard. :frowning: Please add this api function in the next version.