// title: SpeechRender / SpeechBuffer // author: rukano // description: // Little class I made two years ago to generate buffers out of the speech synthesis engine in Mac OS X. // If there is something similar from the command line in Linux or windows, should be easy to adapt the command for those platforms. // One of the first things one learn as SC beginner is "bla bla".speak and it is a lot of fun. But one of the most common problems is: one wants to use that command in SynthDefs. If you like the speech synthesizer now you can turn it into a buffer and use it as you wish. // // Usage: // // b = SpeechBuffer("I am Super... Collider", 3); // string, voice // // b.play; // // play{ PlayBuf.ar(1, b, BufRateScale.kr(b) * 0.5, loop:1)!2 } // // And you have to clean up your rendering directory with: // // SpeechBuffer.cleanUp // or: SpeechRender.cleanUp // // If maybe someone want, this could be turned into a Quark (?) // Have fun! // code: /* Little class to render terminal voices into a temp folder (or a given path) Also can be loaded as buffer. Subclass SpeechBuffer calls the render and loads the buffer automatically. May be adaptable to work on linux (if I knew the command used on linux for rendering from speech synthesis) // USAGE: b = SpeechBuffer("I am Super... Collider", 3); // string, voice b.play; play{ PlayBuf.ar(1, b, BufRateScale.kr(b) * 0.5, loop:1)!2 } // WARNING! // do this regularily until I find a better way to deal with the temp files SpeechBuffer.cleanUp // WARNING! // Files have a 22050Hz sample rate! */ SpeechRender { classvar <>voices, <>defaultVoice; classvar <>tempDir, <>tempPrefix; var