Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[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 interation. rebol [] wave: %any.wav 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)) wait 0.1 prog/data: prog/data + step show prog wait sound-port close sound-port ] view layout [ prog: progress btn "Play" [play wave] ] Regards, Rosemary On Sat, 11 Oct 2008 00:21:11 +1000, Anton Rolls <anton-wilddsl.net.au> wrote:
> 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, > > Regards, > > Anton.
-- message ends