MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Kernel Script For Speech


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



  • Prev by Date: Font problem -Can't type Hindi(Indian language) alphabet into
  • Next by Date: Deleting Palettes
  • Previous by thread: Font problem -Can't type Hindi(Indian language) alphabet into
  • Next by thread: Deleting Palettes