By Sophie Shin
pip3 install -r requirements.txt
sudo apt-get install ffmpeg
or
sudo bash env.sh
Method 1 Only Convert file extension
ffmpeg -i sound3.amr -ar 22050 sound3.wav
Method 2 Convert file extension and edit particular seconds of Audio
python3 editAudio.py -r <beginSec>:<endSec> -i <inputAudioFile> -o <outputAudioFile>
Take this command as an example,
python3 editAudio.py -r 5:20 -i soundfile/0601/30s/sound1.wav -o s.wav
It will split frames automatically when it detects the sound.
Detection standard: dBFS > -15 (max dBFS is 0), and trim sound interval = [sec-50, sec+50]
python3 editAudio.py -a -i <inputAudioFile> -p <outputAudioPath>
Take this command as an example,
python3 editAudio.py -a -i soundfile/0715_pat_correct.wav -p real_training_data/correct
- Create Spectrogram
python3 spectrogram.py -T <Transform> -i <inputAudioPath> -o <saveImagePath>
Take this command as an example,
python3 spectrogram.py -T stft -i 0727_data/testing/ -o 0727_data/testing/
python3 spectrogram.py -T stft -i real_training_data/incorrect/ -o real_training_data/incorrect/img
Output
Input File : sound/
Output Path: img/stft/
STFT Spectrogram Has Created!
python3 cnn.py -i <CorrectImagePath> <InCorrectImagePath>
Take this command as an example,
python3 cnn.py -i ./real_training_data/
or Binary Classification
usage: python3 binary_cnn.py --correct <CorrectImagePath> --incorrect <CorrectImagePath>
Example
python3 binary_cnn.py --correct 0727_data/training/img/stft/ --incorrect 0727_data/incorrect/img/stft/
Validate a Audio file
usage: python3 validation.py -i <AudioFile>
Take this command as an example,
python3 validation.py -i ./0727_data/testing/frame_0.wav
or Validate numerous Audio files
usage: python3 test.py --path0 <IncorrectAudioPath> --path1 <CorrectAudioPath>
Take this command as an example,
python3 validation.py --path0 ./0727_data/incorrect/ --path1 ./0727_data/validation/
$ bash run.sh
usage: python3 wave_plot.py -r <begin>:<end> -i <inputAudioFile> -o <outputAudioFile>
Take this command as an example,
python3 wave_plot.py -r 1:5 -i sound_data/0727_record/1.wav -o example.png