Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11946

Kernel Script For Speech

From pw <p.willis@telus.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Kernel Script For Speech
Date 2012-10-04 03:42 +0000
Message-ID <k4j0j2$7p5$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Kernel Script For Speech pw <p.willis@telus.net> - 2012-10-04 03:42 +0000

csiph-web