Re: advice: program to generate sound from characters



On Jul 30, 4:35 pm, Unruh <unruh-s...@xxxxxxxxxxxxxx> wrote:
babaji <banerjee.anir...@xxxxxxxxx> writes:
Hello all :-) ,
Could someone please help me with a little bit of
advice.
I am planning to write a program which would take as input characters,
say a-z and would output a wav/mp3 file to represent them. e.g. input-
"myname" output-> an mp3 file where a tone will be played for say
0.5 sec to represent each character.
I have searched for packages and have come up with a lot of results. I
am a little overwhelmed by the complexity of some of the packages for
text to speech and the like. Could someone please suggest a simple
program/library which I could use to convert a letter to a tone and
get a wav/mp3 file as output.

I am sure noone has written it. YOu could write your own. Eg, you could use
sox as a translator from an ascii using the .dat data format, and then have
sox convert that to a .wav file.
you could write one .dat for each letter and then convert it.
iThe only problem would be to convert the time in the file to consecutive
times.

timebase=0
for i in m y n a m e
do
awk 'BEGIN {t='$timebase'} {print $1+t " " $2}' $i.dat>>output.dat
timebase=`echo $timebase + .5 |bc`
done
sox output.dat output.wav

Wher I assume that each a.dat, b.dat... have times which go from 0 to
.5-mint
where mint is the minimum timestep.

and a.dat, b.dat, c.dat .... are .dat files which contain the tones you
want to have put in for a b c ...

I have seen festival, and some other text2speech packages, but I am
just wondering if there is something much simpler for my
requirements.
I plan to use the program as a command line utility to convert small
chunks of text to tones.
Thanks,
-A

Thanks so much for your input, it is very helpful. I will bug you just
a little more since this is my first audio programming tryout.

I looked up Sox and installed at was trying to find the file format
of .dat files from

http://aaron.birenboim.com/unix/audioRecording.html
http://www.cs.rutgers.edu/~village/lab/dat2d2wav.html
http://www.boutell.com/scripts/silence.html

and from some other sources. Your script has solved nearly 90% of the
problem :-) . I will work on the rest, but if you can please provide
me another pointer, that would be great.

It seems that .dat is a generic format. Is it the same as .raw? From
http://www.boutell.com/scripts/silence.html and your code it seems
that the .dat file should have at least 2 fields: time and tone/
pitch , is this correct?

Thanks for the help,
-A

.



Relevant Pages

  • Re: PCM wav file to numeric output
    ... On linux "sox" can do this. ... Do a search in google on sox and the ".dat" format (which is a text ... representation of the sample values.) ... It must convert the samples to float format. ...
    (rec.audio.pro)
  • Re: Why DAT failed (was: CD Quality)
    ... It turned out to be a popular professional format, ... I got a great story on DAT's failure from a high-ranking Sony exec, ... or so (when DAT started to ship), they realized to their horror that, because ... first machines to sell for maybe $500 or so, but the U.S. dollar plunged so ...
    (rec.audio.pro)
  • Re: Challenge: reading ascii data
    ... can process the U,V records below -> internal arrays and then output UV ... matches the UV output format shown. ... character:: dat ... output time frames time,u,v,uv from arrays ...
    (comp.lang.fortran)
  • Re: Challenge: reading ascii data
    ... can process the U,V records below -> internal arrays and then output UV product records in format requested by ... I will post my Fortran code once someone posts a non-Fortran solution that matches the UV output format shown. ... character:: dat ... output time frames time,u,v,uv from arrays ...
    (comp.lang.fortran)
  • Re: Challenge: reading ascii data
    ... can process the U,V records below -> internal arrays and then output UV ... matches the UV output format shown. ... character:: dat ... output time frames time,u,v,uv from arrays ...
    (comp.lang.fortran)