Skip to content

Generation of Audio Files

Phil Schatzmann edited this page Feb 20, 2022 · 23 revisions

I used the TTS functionality of google translate to generate the mp3 files. Then I executed xxd to generate a .h file from an mp3 recording with:

xxd -i mp3file.mp3 header-file.h

The header files are then made available with the logic that can be found in AudioDictionary.h

Tools

You can prepare your own audio data easily with the help of a CSV file. Details can be found in the Jupyter Notebook in the tools directory.

CSV File Format

The CSV file has the following format:

Name, Text
zero, zero
one, one
two, two
three, three
four, four
five, five
six, six
@menu1, Hallo this is the main menu
...

The first field is used to identify the audio information and to generate the file name. This value is passed to the audio generation class. The second field is used as input to generate the audio file. Usually both values are the same. However you could decide to record some long text under a short name. In this case we recommend to start the name with a @ character.

Clone this wiki locally