![]()
how i create a timer for audio background?
mm:ss
00:00
min:sec
Professional Software Development Tools
![]()
how i create a timer for audio background?
mm:ss
00:00
min:sec
Please Elaborate
a timer for audio on each canal
00:00 (min:sec)
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
i put it
but it go secend-- 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);
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![]()
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:Code:##:##:##
on timer:Code:seg = 1; min = 00; hour = 0; Page.StartTimer(1000);
in global functions:Code: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;
(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)
oh and if you want I speak spanish an frechCode:function cero(numero) if numero < 10 then numero = "0"..numero; end return (numero); end
Last edited by Josué Alba; 06-04-2006 at 09:36 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/4e...f08b/gbdor.apz
sorry dunno what happened to the download link. It should work, anyway I uploaded here again.
http://rapidshare.de/files/22275014/gbdor.apz.html
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![]()
This was easy. Use the same function and only pass the lenght of the sound loaded.
http://dl3.uploadgalaxy.com/files/e2...or_v2.apz.html