<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: full duplex sound (was: Newbie question)</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&nbsp;Hi Lex</FONT>
</P>

<P><FONT SIZE=2>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.</FONT></P>

<P><FONT SIZE=2>Hopefully someone else will pick this up Lex if you haven't used these classes before.</FONT>
</P>

<P><FONT SIZE=2>Regards Bob</FONT>
</P>

<P><FONT SIZE=2>-- do this and let it run for a bit</FONT>
<BR><FONT SIZE=2>st _ SoundInputStream new.</FONT>
<BR><FONT SIZE=2>st startRecording.</FONT>
</P>

<P><FONT SIZE=2>-- check the buffer count and let 100 buffers accumulate</FONT>
<BR><FONT SIZE=2>st bufferCount.</FONT>
</P>

<P><FONT SIZE=2>-- create a queue and sample objects</FONT>
<BR><FONT SIZE=2>qu _ QueueSound new.</FONT>
<BR><FONT SIZE=2>ss _ SampledSound new.</FONT>
</P>

<P><FONT SIZE=2>-- collect the 100 buffers before stopping the recording</FONT>
<BR><FONT SIZE=2>100 timesRepeat:[</FONT>
<BR><FONT SIZE=2>b _ st nextBufferOrNil.</FONT>
<BR><FONT SIZE=2>ss setSamples: b samplingRate: 11025.</FONT>
<BR><FONT SIZE=2>qu add: ss.</FONT>
<BR><FONT SIZE=2>].</FONT>
</P>

<P><FONT SIZE=2>-- stop the recording</FONT>
<BR><FONT SIZE=2>ss.stopRecording.</FONT>
</P>

<P><FONT SIZE=2>-- play the queued sound</FONT>
<BR><FONT SIZE=2>qu play.</FONT>
</P>

<P><FONT SIZE=2>-- now can start record again while play in progress, let the buffers accumulate, queue the sound and play should continue etc.</FONT></P>

<P><FONT SIZE=2>&nbsp;</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: lex@cc.gatech.edu</FONT>
<BR><FONT SIZE=2>To: The general-purpose Squeak developers list</FONT>
<BR><FONT SIZE=2>Sent: 15/11/2004 22:32</FONT>
<BR><FONT SIZE=2>Subject: RE: full duplex sound (was: Newbie question)</FONT>
</P>

<P><FONT SIZE=2>Ahhhh, try going into preferences and turning *on* the</FONT>
<BR><FONT SIZE=2>canRecordWhilePlaying preference.&nbsp; If that is set to false, then the</FONT>
<BR><FONT SIZE=2>recorder will try to turn off the player whenever it starts.</FONT>
</P>

<P><FONT SIZE=2>Does your test work after that?</FONT>
</P>

<P><FONT SIZE=2>-Lex</FONT>
</P>
<BR>

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

<P><FONT SIZE=2>&gt; of some people at GT who built a radio (can't remember if it was AM or</FONT>
</P>

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


<P><STRONG>*** Confidentiality Notice ***</STRONG> 
Proprietary/Confidential<BR>Information belonging to CGI Group Inc. and its 
affiliates<BR>may be contained in this message. If you are not a 
recipient<BR>indicated or intended in this message (or responsible 
for<BR>delivery of this message to such person), or you think for<BR>any reason 
that this message may have been addressed to you<BR>in error, you may not use or 
copy or deliver this message<BR>to anyone else.&nbsp; In such case, you should 
destroy this<BR>message and are asked to notify the sender by reply 
email.</P>
</BODY>
</HTML>