PDA

View Full Version : audio timer ?


gbdor
06-02-2006, 06:34 PM
:huh

how i create a timer for audio background?

mm:ss
00:00
min:sec

Mina
06-03-2006, 04:28 AM
Please Elaborate

gbdor
06-03-2006, 06:10 AM
a timer for audio on each canal
00:00 (min:sec)

yosik
06-03-2006, 02:42 PM
On each channel, you can use the ratio between Audio.GetCurrentPos(Channel_Number) and Audio.GetLength(Channel_Number). This will give you the relative (ratio) position of that particular channel.
Check the help file:
CHANNEL_BACKGROUND
5

CHANNEL_EFFECTS
0

CHANNEL_NARRATION
6

CHANNEL_USER1
1

CHANNEL_USER2
2

CHANNEL_USER3
3

CHANNEL_USER4
4


Good luck

Yossi

gbdor
06-04-2006, 06:47 AM
i put it
-- set time display
curTime = Math.Round(Audio.GetCurrentPos(CHANNEL_USER1), 2);
if String.Find(curTime, ".", 1, false)==-1 then
curTime = String.Concat(curTime, ".");
end
decPos = String.Find(curTime, ".", 1, false);
strLen = String.Length(curTime);
zerosNeeded = 2 - (strLen - decPos);
if zerosNeeded > 0 then
for count = 1, zerosNeeded do
curTime = curTime.."0";
end
end
Paragraph.SetText("Paragraph1", curTime);
but it go secend
when time arive to 60 next time go to 61 !
i want when time arive to secend 60 then 00:59 -------> 01:00
oh my god i can not good speak english:rolleyes

Josué Alba
06-04-2006, 10:27 PM
hello
this is a basic idea, but you'll need to add a reader for the audio.

create an Input box formated as follows:

##:##:##


on a button:

seg = 1;
min = 00;
hour = 0;
Page.StartTimer(1000);


on timer:

if seg < 60 then
Input.SetText("Input1", cero(hour).. cero(min) ..cero(seg))
else
if min < 59 then
seg = 0;
min = min +1;
Input.SetText("Input1", cero(hour).. cero(min) ..cero(seg))
else
if hour < 24 then
min = 0;
seg = 0;
hour = hour+1;
Input.SetText("Input1", cero(hour).. cero(min) ..cero(seg))
end
end
end
seg = seg +1;


in global functions:
(this function put the "0" for example in 08, if you don't use this you'll get .. 0:0:8 .. 0:0:9 .. 0:0:10 instead od 00:00:08 and so)

function cero(numero)
if numero < 10 then
numero = "0"..numero;
end
return (numero);
end


oh and if you want I speak spanish an frech

Josué Alba
06-04-2006, 11:51 PM
Hehe here you have an example.
It has 4 sounds loaded and you can have 4 separated timers. Using one simple global function. Hope this helps you or solves your problem.

The download is 2.4m because I put a 1 > minunte song, so you can test it goes like 00:01:23...

http://dl2.uploadgalaxy.com/files/4edf5ff6f08b/gbdor.apz

Josué Alba
06-05-2006, 09:53 AM
sorry dunno what happened to the download link. It should work, anyway I uploaded here again.

http://rapidshare.de/files/22275014/gbdor.apz.html

gbdor
06-05-2006, 05:12 PM
tnx it very good
now i want get audio length on background canal
for sampel audio is 280 secend i want this show 04:20 (min:sec)
tnx:)

Josué Alba
06-05-2006, 10:07 PM
This was easy. Use the same function and only pass the lenght of the sound loaded.

http://dl3.uploadgalaxy.com/files/e2f04c024483/gbdor_v2.apz.html