[REBOL] Re: wave progress
From: rcm:formix:au at: 11-Oct-2008 17:59
Thank you Henrik and Anton.
I can't make the progress bar synchronise with the wave file as it's
playing. I realise I need to make a loop, but don't know how to read each
part of the wave. This is the script that gives a "correct" step for one
play: func [audio] [
fileSize: to-integer ((size? wave) / 1024)
sound-port: open sound://
insert sound-port load audio
step: (prog/size/x / (max 1 fileSize))
prog/data: prog/data + step
view layout [
btn "Play" [play wave]
On Sat, 11 Oct 2008 00:21:11 +1000, Anton Rolls <anton-wilddsl.net.au>
> Hi Rosemary,
> Henrik Mikael Kristensen wrote:
>> set-face prog wave-size / point-in-wave-file
>> And that's it. Again, sorry, if I'm way off course.
> Henrik was right in his comments, but I think made a
> slight error. It should be:
> set-face prog point-in-wave-file / wave-size
> where POINT-IN-WAVE-FILE is the current play position,
> and WAVE-SIZE is the total size of the data.
> It's very simple, really. No need to worry about
> the size of the progress bar face, or STEP.
> Let us know how it goes,