full duplex sound (was: Newbie question)

Bob.Cowdery at CGI-Europe.com Bob.Cowdery at CGI-Europe.com
Tue Nov 16 09:48:07 UTC 2004


 Hi Lex

Thanks, one step closer. Full duplex works. I now have to figure out why
although I can record sound and queue it back onto the output I don't
actually hear what was recorded but just a rythmic pulsing noise! I'm sure
this is something to do with the way I am converting the output. This is
basically what I am doing just in a workspace so needs a bit of fiddling
about.

Hopefully someone else will pick this up Lex if you haven't used these
classes before.

Regards Bob

-- do this and let it run for a bit
st _ SoundInputStream new.
st startRecording.

-- check the buffer count and let 100 buffers accumulate
st bufferCount.

-- create a queue and sample objects
qu _ QueueSound new.
ss _ SampledSound new.

-- collect the 100 buffers before stopping the recording
100 timesRepeat:[
b _ st nextBufferOrNil.
ss setSamples: b samplingRate: 11025.
qu add: ss.
].

-- stop the recording
ss.stopRecording.

-- play the queued sound
qu play.

-- now can start record again while play in progress, let the buffers
accumulate, queue the sound and play should continue etc.

 

-----Original Message-----
From: lex at cc.gatech.edu
To: The general-purpose Squeak developers list
Sent: 15/11/2004 22:32
Subject: RE: full duplex sound (was: Newbie question)

Ahhhh, try going into preferences and turning *on* the
canRecordWhilePlaying preference.  If that is set to false, then the
recorder will try to turn off the player whenever it starts.

Does your test work after that?

-Lex


Bob.Cowdery at CGI-Europe.com wrote:
> Hi Lex 
> 
> I did get a little further. I could read audio using SoundInputStream
and I could write it using QueueSound. However, if I recorded some sound
and queued it on QueueSound, stopped recordng and played the QueueSound
as soon as I started recording agin the output stopped so I couldnt get
full duplex going. Obviously i am doing something wrong! 
> 
> Regards 
> Bob 
> 
> -----Original Message----- 
> From: lex at cc.gatech.edu 
> To: squeak-dev at lists.squeakfoundation.org 
> Sent: 13/11/2004 13:47 
> Subject: full duplex sound (was: Newbie question) 
> 
> The full duplex audio should be fine, so long as you do not need the 
> smallest possible latencies.Ê Squeak has in fact been designed with 
> audio applications in mind that need -- e.g., its garbage collector 
> favors low pause-per-GC instead of low overall CPU percentage.Ê I know

> of some people at GT who built a radio (can't remember if it was AM or

> FM) that read files from a swiki and then broadcast them.Ê This radio 
> application sounds simpler than what you are doing, but it suggests
that 
> you can build full audio apps in Squeak. 
> 
> When you say port I/O, is serial port access enough?Ê If so, Squeak
will 
> do fine for you.Ê Look at class SerialPort. 
> 
> These aside, what symptom do you see when you try to play new sounds? 
> Do you get silence, static, or a pre-debug window?Ê I don't know many 
> programming details of sound programming in Squeak, but if you post
more 
> details maybe someone else will recognize the problem. 
> 
> Good luck overall!Ê Squeak should be an excellent platform for you if 
> you can deal with 1-10 ms latencies; you will be able to tweak your 
> program very easily, even while it is running. 
> 
> Lex 
> 
> PS -- Check out the IRC channel if you have not.Ê It is EXCELLENT for 
> people who are starting to use Squeak and thus will bump into all
sorts 
> of oddities and have lots of little questions. 
> 
> *** Confidentiality Notice *** Proprietary/Confidential
> Information belonging to CGI Group Inc. and its affiliates
> may be contained in this message. If you are not a recipient
> indicated or intended in this message (or responsible for
> delivery of this message to such person), or you think for
> any reason that this message may have been addressed to you
> in error, you may not use or copy or deliver this message
> to anyone else.Ê In such case, you should destroy this
> message and are asked to notify the sender by reply email.

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20041116/ce37c796/attachment.htm


More information about the Squeak-dev mailing list