I am using
pocketsphinx to convert audio file to text. These two commands must do the work:
First i run
ffmpeg -i file.mp3 -ar 16000 -ac 1 file.wav
then i run
pocketsphinx_continuous -infile file.wav 2> pocketsphinx.log > result.txt
I do that for each file (mp4 or mp3), I want to execute these two commands only once in a script, by browsing the directory content (files with the extension mp3 or mp4), and give the file the same name with the extension .txt (for exemple with the first command "file.mp3" become "file.wav" then using the second command "file.wav" become "file.txt").
How to do that using a single script file?