├── Vox2Wav.sh └── README.md /Vox2Wav.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | v3_dir=${1} 4 | wav_dir=${2} 5 | wox_ext=${3} 6 | 7 | if [[ -z ${v3_dir} ]]; then 8 | echo "[ERROR] no argument variable is passed as a directory, exiting ..." 9 | exit 64 10 | fi 11 | 12 | if [[ ! -d ${v3_dir} ]]; then 13 | echo "[ERROR] There is no ${v3_dir} directory" 14 | exit 64 15 | fi 16 | 17 | if [[ -z ${wav_dir} ]]; then 18 | echo "[ERROR] no argument variable is passed as an output directory, exiting ..." 19 | exit 64 20 | fi 21 | 22 | if [[ ! -d ${wav_dir} ]]; then 23 | echo "[INFO] Creating ${wav_dir} directory" 24 | mkdir $wav_dir 25 | fi 26 | 27 | echo "[INFO] Converting v3 files in directory ${v3_dir}" 28 | for sound_file in $(ls ${v3_dir}); do 29 | # get the full path 30 | if [[ ! $sound_file == *${wox_ext} ]]; then 31 | echo "[INFO] ${sound_file} is not valid" 32 | continue 33 | fi 34 | sound_path="${v3_dir}/${sound_file}" 35 | wav_path="${wav_dir}/${sound_file%${wox_ext}}.wav" 36 | ffmpeg -f u8 -c adpcm_ima_oki -ar 6.0k -ac 1 -i $sound_path $wav_path 37 | echo "[INFO] Converted ${sound_path} to ${wav_path}" 38 | done 39 | 40 | 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vox2wav 2 | 3 | Converting Vox files to Wav or other formats that are easy to workaround. 4 | 5 | 6 | ## What are Vox files? 7 | 8 | VOX files are audio files used in speech applications. Usually they contain pre-recorded voice prompts. Because voice networks have relatively low bandwidth the audio used can be sampled at a fairly low rate (an ISDN "B" channel carries only 8kHz voice). Consequently, VOX files are often 8kHz (although 6kHz is also possible). 9 | 10 | VOX files can contain audio in different formats. There are at least four different formats: 11 | 12 | Raw A-law 13 | Raw mu-law 14 | 8kHz 4-bit ADPCM (also known as IMA/OKI ADPCM) 15 | 6kHz 4-bit ADPCM 16 | 17 | There is no file header inside a VOX file, only audio samples, so there is no way to know which format a particular file contains. If you play it and it sounds bad (i.e. distorted, wrong speed/pitch, or just ‘noise’), then you are not playing it back in the same way that it was recorded. 18 | 19 | VOX files have been long associated with the Dialogic® DMV and JCT Media Boards, and customers often have collections of recorded prompts stored in "VOX format". 20 | 21 | Using this bash file you can convert a directory full of vox files ending with .V3(this is the default value you can change it) to wav or other formats. 22 | [reference](https://www.dialogic.com/support/helpweb/helpweb.aspx/394/vox_and_vap_files/en) 23 | 24 | # Installation 25 | In case you don't have ffmpeg installed on you os, install with the following commands: 26 | 27 | ```terminal 28 | sudo apt update 29 | sudo apt install ffmpeg 30 | ``` 31 | 32 | # Converting a single file 33 | To check all the supported codecs by ffmpeg run the following command: 34 | ``` 35 | ffmpeg -codecs 36 | # or grep a specific keyword 37 | ffmpeg -codecs | grep adpcm 38 | ``` 39 | Based on the description choose a codecs that satisfies your needs. 40 | 41 | ```bash 42 | vox_path=path-to-vox-file 43 | wav_path=output-path 44 | ffmpeg -f u8 -c adpcm_ima_oki -ar 6.0k -ac 1 -i $vox_path $wav_path 45 | ``` 46 | Name | description 47 | --- |-------------| 48 | -f | file format, u8: unsigned 8-bit 49 | -c | file codec, adpcm_ima_oki: ADPCM IMA Dialogic OKI 50 | -ar | rate, set audio sampling rate (in Hz) 51 | -ac | channels, set number of audio channels 52 | -i | input file path 53 | 54 | 55 | # Converting a directory of vox files 56 | ```bash 57 | vox_dir=path-to-vox-dir 58 | wav_dir=output-dir 59 | vox_ext=.V3 60 | bash Vox2Wav.sh $vox_dir $wav_dir $vox_ext 61 | ``` 62 | --------------------------------------------------------------------------------