Page 1 of 1

Automatically generating voice alerts in Mac OS X

Posted: Wed Aug 15, 2018 1:44 am
by iFeghali
Inspired by this topic http://openrcforums.com/forum/viewtopic.php?f=64&t=6871 I decided to create a bash script that makes use of Mac OS X text to speech capabilities to automatically generate voice alert files.

I am basically using 3 tools to generate the WAV file required by ersky9xr r221:
  • say: converts text into speech (aiff file)
  • afconvert: converts aiff to wav file
  • dd: binary manipulation of wav file
The whole thing, currently in alpha state, is available at https://github.com/ifeghali/ersky9xutils


# Create Voice File
say -v "$VOICE" "$phrase" -o $FAIFF -r $WPM

# Convert AIFF to WAV
afconvert -f WAVE -d [email protected]$FREQ -c 1 $FAIFF $FWAVE

# Convert wav offset from 4096 to 44
dd if=$FWAVE bs=1 count=35 of=$FOUTF >&/dev/null
dd if=$FWAVE bs=1 skip=4087 seek=35 conv=notrunc of=$FOUTF >&/dev/null

Re: Automatically generating voice alerts in Mac OS X

Posted: Wed Aug 15, 2018 8:11 am
by jhsa
If you have access to a windows computer just download and install "TTSautomate". It will build your pack for you in seconds :)

João