http://bugzilla.novell.com/show_bug.cgi?id=586875
http://bugzilla.novell.com/show_bug.cgi?id=586875#c2 --- Comment #2 from Rick Gross <[email protected]> 2010-03-15 13:40:46 UTC --- [Export("ThreadSay")] void ThreadSay (object input) { using(var pool = new NSAutoreleasePool()) { string textToSpeak = input.ToString(); try{ //while (audioPlayer!=null) //{ //wait if already speaking //} var basedir = Path.Combine (Environment.GetFolderPath(Environment.SpecialFolder.Personal), ".."); var tmpdir = Path.Combine(basedir, "tmp"); string audioFilePath = Path.Combine(tmpdir, "foo.wav"); Debug.WriteLine("start TTS - " + DateTime.Now.ToLongTimeString()); //TextToSpeech tts = new TextToSpeech(); var tts = new TextToSpeech(); tts.ConvertTextToWav(textToSpeak, audioFilePath, 2);//Was 2 Debug.WriteLine("end TTS - " + DateTime.Now.ToLongTimeString()); //AVAudioPlayer audioPlayer = new AVAudioPlayer(NSUrl.FromFilename(audioFilePath), null); string volLevel = store.GetPref("volume"); if(volLevel=="") { volLevel="1"; } var audioPlayer = AVAudioPlayer.FromUrl (new NSUrl (audioFilePath, false)); //audioPlayer = AVAudioPlayer.FromUrl (new NSUrl (audioFilePath, false)); audioPlayer.PrepareToPlay(); audioPlayer.Volume = store.volLevel; //float.Parse(volLevel); audioPlayer.Play(); } catch(Exception ex) { Console.WriteLine(ex.Message.ToString()); } } } -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
