A simple tool to help you extend music!
Compile the code with
make ansi
Run the program using
./main /path/to/input.wav /path/to/output.wav MIN_DURATION [START_TIME END_TIME]
Notes:
- Input file should be an uncompressed WAV file (see Convert Audio to WAV for more info).
MIN_DURATION
,START_TIME
andEND_TIME
are in seconds and should be integers.- If
START_TIME
andEND_TIME
are not provided, the program will attempt to find the music loop on its own. For best results, it is recommended for the input file to have at least 2 loops of the music.
Example:
./main input.wav output.wav 300 1 73
Generating uncompressed wav files using ffmpeg:
- stereo audio file
ffmpeg -i INPUT_FILE -acodec pcm_s16le OUTPUT_FILE
- mono audio file
ffmpeg -i INPUT_FILE -acodec pcm_s16le -ac 1 OUTPUT_FILE
Commands to run the Python testing code:
- Python environment setup
python3.10 -m venv venv
- Activate python env
source venv/bin/activate
- Install dependencies
python -m pip install -r requirements.txt
- Build shared object file for wav file parser to be used by python script
gcc -shared -o parse_wav.so -fPIC parse_wav.c
- Run testing script (it checks that parse_wav.c returns the same values as the librosa library)
python py_testing/audio_test.py