› Forums › Basic skills › Programming › Shell scripting (in bash) › Cannot execute binary file
- This topic has 3 replies, 3 voices, and was last updated 4 years, 4 months ago by Simon.
-
AuthorPosts
-
-
February 2, 2018 at 12:49 #9021
I am having trouble downsampling the recording files. My for loop seems to work, but the terminal complains that it cannot execute the binary file:
./scripts/downsample_wavfiles.sh: line 11: recordings/ArcticA/arctic_a0001.wav: cannot execute binary file
However, I do not wish to execute the recording files, I just want to alter them with the sox command. I haven’t found any useful solutions online either.
This is how my script looks:
#!/usr/local/bin/bash RECDIR=recordings/ArcticA for F in `${RECDIR}/*.wav` do #ch_wave -otype riff -F 16000 -o wav/${F} recordings/${F} sox $F -b16 -r 16k wav/`basename $F.wav` done
-
February 2, 2018 at 16:50 #9023
Whenever you see the error message “cannot execute binary file” referring to a file that should never be executed, you need to look for a place where that file is the first thing on a line in the shell script.
In your case, this is within the backticks on line 11. Backticks create a new shell and the contents are passed to this new shell to be executed. In your case, the contents will be a list of wav files.
You need either:
for F in `ls ${RECDIR}/*.wav`
or
for F in ${RECDIR}/*.wav
or the fancier
for F in `find ${RECDIR} -name "*.wav"`
-
April 5, 2020 at 00:42 #11092
I’m having this issue with endpointing. I’m trying to do the modification of training on less data and I get another error when I run make_mfccs if I don’t do endpointing (as I have seen in a previous run through the commands).
I’ve run these commands:
for FILE in wav/*.wav; do sox $FILE ../silenceTrimmed/$FILE vad -t 6 -s 0.1 -p 0.1 reverse vad -t 4 -s 0.1 -p 0.3 reverse; done
for FILE in ‘ls wav/*.wav’; do sox $FILE ../silenceTrimmed/$FILE vad -t 6 -s 0.1 -p 0.1 reverse vad -t 4 -s 0.1 -p 0.3 reverse; done
and I get the following error:
/Volumes/Network/courses/ss/festival/festival_mac/multisyn_build/bin/sox: cannot execute binary file
-
April 5, 2020 at 09:13 #11094
The “festival_mac” in the PATH is the clue. It’s a curious bug. See this topic.
-
-
AuthorPosts
- You must be logged in to reply to this topic.