Circular Audio Progress bar
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
"Circular Audio Progress bar" is a funny title, as a Progress bar is never circular.
So, "Suffer for it!":
-
So, "Suffer for it!":
-
- Attachments
-
- COUNTER 2.livecode.zip
- Here's the stack.
- (67.31 KiB) Downloaded 300 times
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Circular Audio Progress bar
Great words, but where is the audio part of your answer?Richmond wrote:You'll take the LCB road and I'll take the LC road, And I'll get my stack finished afore you.
You didn't even notice that my solution above is pure LC Script.
So, what is your problem?
shiftLock happens
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
Aha: so you're a qualified psychiatrist as well.So what is your problem?
My "only" problem is that the circular progress "bar" is so simple
I wondered why it had to be delivered as a widget,
therefore making it more difficult for people to modify.
Yes! The "audio bit" is missing . . .
But. presumably this progress "thing" is meant to be used while
an audio files launches, so that "bit" should be elementary.
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
Aha: so it has to be synced with the length of the audio file.It basically just fills the color of the stroke of the circle in sync with the audio playback time.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Circular Audio Progress bar
The OP wrote:
Really simple, no "progress" needed.
So finish your stack and show him that elementary thing, in LC Script. Move a player's slider and buttons and show that with your simple progress. My solution above does that, in LC Script, even creates the "progress" display by script, no LCB/widget needed.
"While an audio file launches" shows always a progress of 0%. And the length of the audio file shows always 100%.How do you connect this to an audio timeframe?
Really simple, no "progress" needed.
So finish your stack and show him that elementary thing, in LC Script. Move a player's slider and buttons and show that with your simple progress. My solution above does that, in LC Script, even creates the "progress" display by script, no LCB/widget needed.
shiftLock happens
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
The last time I worked with audio in LIveCode it was called Runtime Revolution, in 2002, and was dependent on Quicktime,
so I will leave the "audio bit" to someone who is a 'twitch' more up to date re audio in LIveCode .
-
so I will leave the "audio bit" to someone who is a 'twitch' more up to date re audio in LIveCode .
-
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Circular Audio Progress bar
I used the player object not yet in LC 9, so detected now a small bug with it in LC 9 (return sometimes a currentTime > duration). Edited my solution above by a 'work around'.
@Richmond.
Anyway, now we know your problem: Answering the trivial part of a question only and at the same time judging other (full) answers as "complicated" ...
@Richmond.
Anyway, now we know your problem: Answering the trivial part of a question only and at the same time judging other (full) answers as "complicated" ...
shiftLock happens
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
OK, OK; you got me there: and I do apologise.Answering the trivial part of a question only and at the same time judging other (full) answers as "complicated" ...
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Circular Audio Progress bar
Never mind. Often you are right when simplifying complicated things. (But not always.)
shiftLock happens
-
- Posts: 25
- Joined: Wed Aug 28, 2019 4:58 pm
Re: Circular Audio Progress bar
WOW! This is the best forum I have been part of! Thank you very much for all your help! I hope I get to the point that I can contribute to help people, too! I am a long time Adobe(wished it had still been Macromedia) Director. Livecode is very similar but still enough differences that it takes me a little bit to delete the Director knowledge and think in the way Livecode expects it. Thank you again so much for the help!
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
So: how does one find the length of an audioClip programmatically?
- -
You can get the duration of a player . . .
- -
You can get the duration of a player . . .
Last edited by richmond62 on Wed Oct 02, 2019 7:41 pm, edited 1 time in total.
Re: Circular Audio Progress bar
I'm afraid we can't!
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
That's "a pity" . . .
OK: so, having done this:
and got: 119808
and having done this:
and got: 48000
and reading this:
The Happy MacOS 'get info' thing states that my a55.aiff file has a duration of 2 seconds,
but 119808 / 48000 gives me 2.496
Of course MacOS could be rounding down, or 2.496 could mean something else.
OK: so, having done this:
Code: Select all
put the duration of player "wazoo"
and having done this:
Code: Select all
put the timescale of player "wazoo"
and reading this:
The inevitable Q has got to be how to use those 2 numbers to work out ticks for a progress bar/circle.The timeScale is the number of intervals per second of a movie or sound.
These intervals are used for the player's startTime, endTime, duration, and currentTime properties,
and you can use the timeScale property to convert from the time scale used by the movie or sound to seconds.
The Happy MacOS 'get info' thing states that my a55.aiff file has a duration of 2 seconds,
but 119808 / 48000 gives me 2.496
Of course MacOS could be rounding down, or 2.496 could mean something else.
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
Blast!
- -
The sound file finishes while the progress graphic is about half complete:
probably because LiveCode does not like. wait 0.416 ticks
- -
Code: Select all
on mouseUp
put the duration of player "wazoo" into DURANCE
put the timescale of player "wazoo" into TS
put ((DURANCE / TS) * 60) into TIX
put (TIX/360) into DIVZ
-----
play player "wazoo"
set the startAngle of grc "CRUNCH" to 0
put 0 into DEG
repeat until DEG > 360
set the arcangle of grc "CRUNCH" to DEG
set the label of grc "MASK" to DEG
add 1 to DEG
wait DIVZ ticks with messages
end repeat
-----
end mouseUp
probably because LiveCode does not like. wait 0.416 ticks
-
- Livecode Opensource Backer
- Posts: 9387
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Circular Audio Progress bar
I really hate that word 'can't'!I'm afraid we can't!
And we can:
Code: Select all
on mouseUp
put the size of audioClip "a55.aiff" into SZ
put (SZ / 4)
end mouseUp
linked to an external instance of the sound file 'a55.aiff'.
Last edited by richmond62 on Wed Oct 02, 2019 8:23 pm, edited 1 time in total.