Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Kernel Script For Speech
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
pw

Posts: 14
Registered: 10/3/12
Kernel Script For Speech
Posted: Oct 3, 2012 11:42 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.