Kernel Script For Speech
- To: mathgroup at smc.vnet.net
- Subject: [mg128286] Kernel Script For Speech
- From: pw <p.willis at telus.net>
- Date: Wed, 3 Oct 2012 23:41:35 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
Hello,
I have set up ~/.Mathematica/kernel/sound.m to work with Ubuntu Linux
Precise Pangolin as follows:
(******************************************************************)
(*
* Set up a $SoundDisplayFunction for the
* Linux version of Mathematica and potentially other unixes, too.
*)
Begin["System`Private`"]
Unprotect[$SoundDisplayFunction]
Clear[$SoundDisplayFunction]
$SoundDisplayFunction :=
Module[{playCmd,soundFileName},
Export[$SoundDisplay, #1];
(* is there a way to get the sample rate, etc. from the audio
stream? *)
playCmd = "/usr/bin/play";
soundFileName = "/tmp/" <> ToString[Unique["sound"]] <> ".wav";
playCmd = playCmd <> " " <> soundFileName;
Export[soundFileName, #1, "WAV"];
Run[playCmd];
Run["/bin/rm -f " <> soundFileName];
] &
Protect[$SoundDisplayFunction]
End[];
(******************************************************************)
This was a minor modification of a similar script found on the web.
QUESTION:
I am trying to make the Speak[] function work.
I would like to use the command line functionality of 'espeak'
which works just fine on my distro.
What function do I need to define in ~/.Mathematica/kernel to
plug perform a similar function for Speak[]; as has been done
above for Play[];
Thank you
Peter