<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Glen,<div><br></div><div>Yes, as you've figured out you need to use NSMutableData and property 3331.</div><div>Here's an example that will do what you want (caveat to follow :-)</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(206, 191, 126); min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><span style="color: #cebf7e">(</span><span style="color: #d20000">define</span><span style="color: #cebf7e"> </span>speech<span style="color: #cebf7e"> (</span>au:make-node<span style="color: #cebf7e"> </span><span style="color: #7e09ff">"augn"</span><span style="color: #cebf7e"> </span><span style="color: #7e09ff">"ttsp"</span><span style="color: #cebf7e"> </span><span style="color: #7e09ff">"appl"</span><span style="color: #cebf7e">))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><span style="color: #cebf7e">(</span>au:connect-node<span style="color: #cebf7e"> </span>speech<span style="color: #cebf7e"> </span><span style="color: #6167ff">0</span><span style="color: #cebf7e"> </span>*au:output-node*<span style="color: #cebf7e"> </span><span style="color: #6167ff">0</span><span style="color: #cebf7e">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><span style="color: #cebf7e">(</span>au:update-graph<span style="color: #cebf7e">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(206, 191, 126); min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(126, 9, 255); "><span style="color: #cebf7e">(</span><span style="color: #d20000">define</span><span style="color: #cebf7e"> </span><span style="color: #ff7f00">dat</span><span style="color: #cebf7e"> (</span><span style="color: #ff7f00">objc:call</span><span style="color: #cebf7e"> </span>"NSMutableData"<span style="color: #cebf7e"> </span>"dataWithLength:"<span style="color: #cebf7e"> </span><span style="color: #6167ff">4</span><span style="color: #cebf7e">))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><span style="color: #cebf7e">(</span><span style="color: #d20000">define</span><span style="color: #cebf7e"> </span>my-speech-channel-data<span style="color: #cebf7e"> (</span>objc:call<span style="color: #cebf7e"> </span>dat<span style="color: #cebf7e"> </span><span style="color: #7e09ff">"bytes"</span><span style="color: #cebf7e">))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><span style="color: #cebf7e">(</span>au:get-property<span style="color: #cebf7e"> </span>speech<span style="color: #cebf7e"> </span><span style="color: #6167ff">3331</span><span style="color: #cebf7e"> </span>*au:global-scope*<span style="color: #cebf7e"> </span><span style="color: #6167ff">0</span><span style="color: #cebf7e"> </span>my-speech-channel-data<span style="color: #cebf7e"> </span><span style="color: #6167ff">4</span><span style="color: #cebf7e">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(206, 191, 126); min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><span style="color: #cebf7e">(</span>au:speak<span style="color: #cebf7e"> (</span>now<span style="color: #cebf7e">) </span>my-speech-channel-data<span style="color: #cebf7e"> </span><span style="color: #7e09ff">"hello world"</span><span style="color: #cebf7e">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(255, 127, 0); "><font class="Apple-style-span" color="#CEBF7E"><br></font></div></div></div><div><div><div>The caveat is that au:speak does not work with the speech AU. Behind the scenes this is because the speech AU requires a different "speech" call. Seeing as we can now use the speech AU (which was not available prior to 10.5) I'm going to switch au:speak over to use this new call (this will be in 1.4) and deprecate the old au:get-speech* code.</div><div><br></div><div>Cheers,</div><div>Andrew.</div><div><br></div><div>On 20/03/2009, at 3:04 AM, Glen F wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">To (partly) answer myself -- I didn't get the TTY speech AU to work yet, but I did manage to get it to work using NetAudio and the shell command "say -n"...I'd still like to know if it's possible the other way, directly using the "ttsp" Audio Unit and Impromptu speech commands... Here's the (or, at least, a) working version:<div> <br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(122, 18, 255); "><span style="color: #000768">(</span><span style="color: #990000">define</span><span style="color: #000768"> reverb (</span><span style="color: #b34c00">au:make-node</span><span style="color: #000768"> </span>"aufx"<span style="color: #000768"> </span>"mrev"<span style="color: #000768"> </span>"appl"<span style="color: #000768">))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(122, 18, 255); "><span style="color: #000768">(</span><span style="color: #990000">define</span><span style="color: #000768"> netaudio (</span><span style="color: #b34c00">au:make-node</span><span style="color: #000768"> </span>"augn"<span style="color: #000768"> </span>"nrcv"<span style="color: #000768"> </span>"appl"<span style="color: #000768">))</span></div> <div><span class="Apple-style-span" style="color: rgb(0, 7, 104); font-family: Monaco; font-size: 12px;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">(</span>au:connect-node<span style="color: #000768"> </span>netaudio<span style="color: #000768"> </span><span style="color: #0000ff">0</span><span style="color: #000768"> </span>reverb<span style="color: #000768"> </span><span style="color: #0000ff">0</span><span style="color: #000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">(</span>au:connect-node<span style="color: #000768"> </span>reverb<span style="color: #000768"> </span><span style="color: #0000ff">0</span><span style="color: #000768"> </span>*au:output-node*<span style="color: #000768"> </span><span style="color: #0000ff">0</span><span style="color: #000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">(</span>au:update-graph<span style="color: #000768">)</span></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "> <span style="color: #000768">(</span>au:set-param<span style="color: #000768"> (</span>now<span style="color: #000768">) </span>netaudio<span style="color: #000768"> </span><span style="color: #0000ff">0</span><span style="color: #000768"> </span>*au:global-scope*<span style="color: #000768"> </span><span style="color: #0000ff">0</span><span style="color: #000768"> </span><span style="color: #0000ff">4</span><span style="color: #000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">; That actually doesn't work (nor to the values 0, 1, 2, 3).</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "> <span style="color: #000768">; I'm not sure how to set the state to "connecting" without using</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">; the "connect" button in the UI! Until I learn otherwise...click it!</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">(</span>au:open-view<span style="color: #000768"> </span>netaudio<span style="color: #000768">)</span></div><div> <br></div><div>; perhaps there's a more elegant way to do this?</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(0, 7, 104); ">(<span style="color: #990000">define</span> <span style="color: #b34c00">shell</span> <span style="color: #7a12ff">"do shell script \"</span>say -n AUNetSend 'ree-verby!'\"")</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color: #000768">(</span>sys:run-applescript<span style="color: #000768"> </span>shell<span style="color: #000768">)</span><br></div> <div><br></div></div></div></span></div><br><div class="gmail_quote">On Thu, Mar 19, 2009 at 12:31 PM, Glen F <span dir="ltr"><<a href="mailto:holaglen@gmail.com">holaglen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Hi there -- can anyone help me get speech synthesis working as an Audio Unit? I did it "without", but discovered it was not recorded when using au:start-audio-capture...therefore, I want to set it up using an AU.<div> <br></div><div>Seems there are a few options, but the most tantalizing is the speech AU in OS X 10.5...(don't need to use NetReceive) But I'm not sure how to get it to talk...I need to get the relevant "channel", but am not familiar enough with this stuff to know exactly how...</div> <div><br></div><div><p style="margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Monaco;color:#7a12ff"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span><span style="color:#990000">define</span><span style="color:#000768"> </span>speech<span style="color:#000768"> (</span>au:make-node<span style="color:#000768"> </span><span style="color:#7a12ff">"augn"</span><span style="color:#000768"> </span><span style="color:#7a12ff">"ttsp"</span><span style="color:#000768"> </span><span style="color:#7a12ff">"appl"</span><span style="color:#000768">))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span><span style="color:#990000">define</span><span style="color:#000768"> </span>reverb<span style="color:#000768"> (</span>au:make-node<span style="color:#000768"> </span><span style="color:#7a12ff">"aufx"</span><span style="color:#000768"> </span><span style="color:#7a12ff">"mrev"</span><span style="color:#000768"> </span><span style="color:#7a12ff">"appl"</span><span style="color:#000768">))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span>au:connect-node<span style="color:#000768"> </span>speech<span style="color:#000768"> </span><span style="color:#0000ff">0</span><span style="color:#000768"> </span>reverb<span style="color:#000768"> </span><span style="color:#0000ff">0</span><span style="color:#000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span>au:connect-node<span style="color:#000768"> </span>reverb<span style="color:#000768"> </span><span style="color:#0000ff">0</span><span style="color:#000768"> </span>*au:output-node*<span style="color:#000768"> </span><span style="color:#0000ff">0</span><span style="color:#000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span>au:update-graph<span style="color:#000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span>au:print-graph<span style="color:#000768">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(0, 7, 104); min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(179, 76, 0); "><span style="color:#000768">(</span><span style="color:#990000">define</span><span style="color:#000768"> </span>voice1<span style="color:#000768"> (</span>au:get-speech-channel<span style="color:#000768">)) ; this is wrong, I think...?</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(0, 7, 104); min-height: 16px; "><span style="color:rgb(179, 76, 0)"><span style="color:#000768">(</span>au:speak<span style="color:#000768"> (</span>now<span style="color:#000768">) </span>voice1<span style="color:#000768"> </span><span style="color:#7a12ff">"Ree-verby!"</span><span style="color:#000768">) ; seems to use a non-AU voice channel</span></span><br> </div><div><span style="color:rgb(0, 7, 104)"><span style="color:rgb(0, 0, 0);font-family:arial;font-size:13px"><div><br></div><div>I think I'd need to use au:get-property on property 3331 (kAudioUnitProperty_SpeechChannel), but am not sure exactly how to set things up using NSMutableData and all that...or even if that's the right approach. Or do I need to use the system call "say -n" and NetReceive AUnit to get this going?</div> <div><br></div><div>Thanks for any tips,</div><div>Glen.</div><div><br></div><div><br></div><div><br></div></span></span></div><div><br class="webkit-block-placeholder"></div></div> </blockquote></div><br></div> _______________________________________________<br>Impromptu mailing list<br><a href="mailto:Impromptu@lists.moso.com.au">Impromptu@lists.moso.com.au</a><br>http://lists.moso.com.au/mailman/listinfo/impromptu<br></blockquote></div><br></div></body></html>