Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
3e0e2dea3This file is pinned to the selected release. Download the original to open it in your design tool.
# Converting sound clips
In this project, sound clips generally reside as header files with large arrays of data points.
First, ensure that your clip is adequately loud and well-cropped with a tool like [Audacity](https://www.audacityteam.org).
Also ensure the [ffmpeg](https://ffmpeg.org/) tool is installed where the script can find it.
Next, check the sample rate in your [`config.h`](/software/combadge/config.h) in the `SAMPLE_RATE` definition.
Also note the bitness defined with `sample_t` (e.g. `int16_t` is 16-bit).
Finally, invoke `HeaderFromSound.py` to generate the header file accordingly.
```
HeaderFromSound.py [-h] [--rate SAMPLERATE] [--bitness BITNESS] [--name CLIPNAME] INPUTFILE
```
Here's an example:
```sh
python3 /path/to/HeaderFromSound.py --bitness 16 --rate 44100 --name Chirp > Chirp.h
```
Move the generated header file to the appropriate [location](/software/combadge/sounds) and use.