[prev in list] [next in list] [prev in thread] [next in thread] 

List:       festival-talk
Subject:    FT: Writing output to file (sound format problem)...
From:       Alan W Black <awb () cs ! cmu ! edu>
Date:       2000-03-03 18:31:15
[Download RAW message or body]

message from Alan W Black <awb@cs.cmu.edu> to festival-talk
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


 Graham Street writes on 3 March 2000:
 > message from Graham Street <gstreet@oscar.penguinpowered.com> to festival-talk
 > = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 > 
 > Hi all,
 > 
 > I'm trying to use festival to write a standard .au file so my software
 > can then play it as needed...
 > 
 > Write now I'm using:
 > (Parameter.set 'Audio_Command "mv $FILE /tmp/test.au")
 > (Parameter.set 'Audio_Required_Rate 16000)
 > (Parameter.set 'Audio_Required_Format 'snd)
 > (Parameter.set 'Audio_Method 'Audio_Command)
 > (SayText "This is a test")
 > 
 > This does indeed creade a file called test.au, and I can play it with
 > 'play' command.. However, the program that I need it to be played by doesn't
 > like it at all.. Sounds like loud static.  I can send another .au file
 > (one supplied by my os distribution for example) to this  program and it works
 > fine... 
 > 
 > This makes me suspect a difference in the file format... perhaps just rate?
 > I'm not very familiar with audio stuff so maybe you can help me out here...
 > What is the standard "au" rate? Are there any other format parameters I
 > should play with?

There is (mistaken) believe by some programs (and sometimes people
too, though in your case) that field extensions (.au) define the
header formats in files.  Which can confuse things.  The 'snd file
format specified above creates a files with what can best be
described as a Sun header on it.  Sun Microsystems have their
own format but as they're quite as omipresent as Microsoft their
formats is as widelyy supported.  Confusingly Sun's format is 
oftern referred to as .au format, which is unturns is often
confused with unheadered u-law 8K 8 bit files.  The http audio/basic
is defined as u-law 8k 8bit, except examples of it are very often 
sun headered.  Sun headered (16bit) files are big endian (i.e.
different from Intel byte order),

 > Specifically what i'm trying to do is take the .au file generated by
 > Festival and send it to 'toast'.  This produces a .gsm file that I proceed
 > to play on my modem hardware. Again, it works with some .au files but
 > not the one generated by Festival.
 > 
 > Here are the options toast takes if that helps:
 >  -u  u-law     Force 8 kHz/8 bit u-law in/output format
 >  -s  sun .au   Force Sun .au u-law in/output format
 >  -a  A-law     Force 8 kHz/8 bit A-law in/output format
 >  -l  linear    Force 16 bit linear in/output format
 > 

If I had to do this I would do (but see below)

 (Parameter.set 'Audio_Command "mv $FILE /tmp/test.au")
 (Parameter.set 'Audio_Required_Rate 8000)
 (Parameter.set 'Audio_Required_Format 'ulaw)
 (Parameter.set 'Audio_Method 'Audio_Command)

and use toast with the -u option.  The second (-s) option looks
like it wants headered ulaw (which you we do support) but the ulaw
one is probably easiest.  But I think the above isn't the
best way to get a waveform from a piece of text.  I would use
the script  text2wave (which is in festival/examples in the distribution

   echo "hello world" | text2wave -otype ulaw /tmp/test.au

or

   text2wave -otype ulaw -o /tmp/test.au mumble.txt

Call text2wave with argument -h to see all the options.

Or if you really need to use festival interactively I would copy
the SayText function and modify it like this and put it in a file
say mumble.scm

(define (SaveText text ofile otype)
"(SaveText TEXT)
Synthesize given text and save waveform in named file."
  (let ((utt (eval (list 'Utterance 'Text text))))
   (utt.synth utt)
   (utt.save.wave utt ofile otype)))

Then start festival as

   festival mumble.scm
   ...
   festival>  (SaveText "Hello World" "/tmp/text.au" 'ulaw)



--

Alan

Alan W Black                                email: awb@cs.cmu.edu
Language Technologies Institute             http://www.cs.cmu.edu/~awb/
Carnegie Mellon University                  tel: +1-412-268-6299  
5000 Forbes Ave, Pittsburgh PA, 15213, USA. fax: +1-412-268-6298











= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
			       Sent Via festival-talk@cstr.ed.ac.uk
		        To unsubscribe mail majordomo@cstr.ed.ac.uk

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic