Closed jeff1evesque closed 10 years ago
d188c1e: Minor changes regarding spacing between lines of code.
a8c2c7c: Our initial assumption was correct. We made the changes involving only reconfiguring audio files that were not of the form 16 bit, 16 kHz, mono
, otherwise we simply perform a cp
command. The results indicate that the translation occurred in under a minute.
After Reboot: The following were executed immediately after sudo reboot
:
$ cd /var/www/audio-analyzer/audio/recording
$ sudo rm * ../recording_converted/* ../recording_text/*
$ sudo cp ../../pocketsphinx/audio/sample.wav sample.wav
$ ls -l
-rw-r--r-- root root 367922 2014-07-12 1:34 sample.wav
$ (cd ../recording_converted && ls -l)
-rw-r--r-- root root 367922 2014-07-12 1:34 sample.wav
$ (cd ../recording_text && ls -l)
-rw-r--r-- root root 180 2014-07-12 1:35 sample
Repeat: The following were executed immediately after above, without sudo reboot
:
$ cd /var/www/audio-analyzer/audio/recording
$ sudo rm * ../recording_converted/* ../recording_text/*
$ sudo cp ../../pocketsphinx/audio/sample.wav sample.wav
$ ls -l
-rw-r--r-- root root 367922 2014-07-12 1:37 sample.wav
$ (cd ../recording_converted && ls -l)
-rw-r--r-- root root 367922 2014-07-12 1:37 sample.wav
$ (cd ../recording_text && ls -l)
-rw-r--r-- root root 180 2014-07-12 1:38 sample
a8c2c7c: Our logic is reversed. Currently the logic reads, if the file is already properly configured, reconfigure it. This should be changed to, if the file is not properly configured, reconfigure it.
2464d97: Our correct logic produces similar time results as earlier.
After Reboot: The following were executed immediately after sudo reboot:
$ cd /var/www/audio-analyzer/audio/recording
$ sudo rm * ../recording_converted/* ../recording_text/*
$ sudo cp ../../pocketsphinx/audio/sample.wav sample.wav
$ ls -l
-rw-r--r-- root root 367922 2014-07-12 9:19 sample.wav
$ (cd ../recording_converted && ls -l)
-rw-r--r-- root root 367922 2014-07-12 9:19 sample.wav
$ (cd ../recording_text && ls -l)
-rw-r--r-- root root 180 2014-07-12 9:20 sample
Repeat: The following were executed immediately after above, without sudo reboot:
$ cd /var/www/audio-analyzer/audio/recording
$ sudo rm * ../recording_converted/* ../recording_text/*
$ sudo cp ../../pocketsphinx/audio/sample.wav sample.wav
$ ls -l
-rw-r--r-- root root 367922 2014-07-12 9:21 sample.wav
$ (cd ../recording_converted && ls -l)
-rw-r--r-- root root 367922 2014-07-12 9:21 sample.wav
$ (cd ../recording_text && ls -l)
-rw-r--r-- root root 180 2014-07-12 9:22 sample
We need to move filename="${file##*/}"
outside the if-else
logic, this way it can be used for both. Currently both blocks utilize the variable filename
. However, only the else
block defines it. There is a possibility this will resolve the issue of audio recordings from the browser not being translated.
It may be possible that the process of reconfiguring an audio file to
16 bit, 16 kHz, mono
doubles the time it takes to translate an audio file to a text file compared to simply translating the audio to text, https://github.com/jeff1evesque/audio-analyzer/issues/236#issuecomment-48745620.There is also a chance that the general process of bash automation doubles the translation time because of the general use of inotifywait. Regardless, which is the cause, we will proceed by changing the code within
converter_wav_rate
. That is, we will only reconfigure audio files into16 bit, 16 kHz, mono
if the audio file is in a different format. This will involve checking the format of the audio file, and implementing the corresponding logic. Otherwise, we will perform a simplecp
command of the audio file from:into the directory: