help with SoundRecorder

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Thu Nov 20 14:38:11 UTC 2003


On Wed, Nov 19, 2003 at 06:44:22PM -0800, Yoshiki Ohshima wrote:
>   Josh,
> 
>   Did you get the answer for your question?  Or by now, you figured it
> out, probably^^;

Hi Yoshiki,

No, I haven't figured it out yet... I was hoping that someone would tell
me that there's a trivial (read: already implemented) way to do this.
Since it appears that there isn't, I'll just have to do it myself.  I can
tell that the suggestions you offered will be helpful.

Thanks,
Joshua

> 
>   I can think of a way in which making a subclass of SoundRecorder and
> override #emitBuffer: that stores the frame to somewhere else (let's
> call this MyBuffer), instead of adding to recoredSound instance
> variable.
> 
>   MyBuffer could store the "frames" with the timecode, of course.
> 
>   Sidenote: If you use GSMCodec or such, take a look at the
> SoundCodec>>...NoReset:... families in the updated Croquet image.  It
> will prevent you from getting annoying noise at inter frames.
> 
>   Speaking of synchronization, I would imagine that you don't get a
> resolution better than 20ms or such...  bounded by the frame size of
> the recorder and morphic intercycle pause, I guess.  But, probably
> this is good enough.
> 
>   Hope this helps,
> 
> -- Yoshiki
> 
> 
> At Tue, 18 Nov 2003 00:24:58 -0500,
> Joshua 'Schwa' Gargus wrote:
> > 
> > Hello,
> > 
> > I have an application with two modes: "edit" (where user input is
> > logged, and audio is recorded), and "history" (where a slider bar
> > allows you to traverse to any state created by the user input).  If
> > you want, you can use the slider to rewind to a point before an
> > undesired modification, and then switch back to "edit" mode and carry
> > on with further input.
> > 
> > Perhaps it would be better if I am a bit more concrete.  Assume that
> > the program starts in "edit" mode, and the user performs various
> > operations with the mouse for 20 seconds, at the same time as
> > speaking.  The user then switches to "history" mode, and uses the
> > slider bar to recreate the state of the program as it was after 15
> > seconds.  Switching back to "edit" mode causes the last 5 seconds of
> > mouse input and audio data to be truncated; subsequent audio and mouse
> > input are appended after the 15-second mark.
> > 
> > Ok, I think that's clear enough.  My question is about how to make
> > this work with SoundRecorder.  If I have an instance of SoundRecorder
> > that has recorded 20 seconds of audio, how can I stop recording, seek
> > to the 15 second mark, truncate everything after it, and append
> > subsequent audio after that point?
> > 
> > Another question deals with synchronization... assume that I record
> > several minutes of audio and mouse input, and that I want to later
> > replay both the audio and user input simulaneously.  Are there any
> > synchronization issues I ought to be aware of?  Asked another way, do
> > I have to do anything special to ensure that the user input and audio
> > do not become out-of-sync?
> > 
> > Many thanks,
> > Joshua
> > 
> > 



More information about the Squeak-dev mailing list