Closed jeff1evesque closed 10 years ago
fe8fbe4: did not change the outcome, we will remove it for now.
The following resolved sub-issues from the issue Reconfigure audio efficiently using ffmpeg attempts to resolve bash automation via the web-browser:
filename="${file##*/}"
within the else
block, however, it was also used within the if
block (see sub-issue).We incorrectly closed this issue. The issue regarding the translation of audio to text via bash automation within the web browser, still needs to be fixed.
We know upload.php
saves the audio file into the recording/
subdirectory, and contains the following line of code:
...
$saved = move_uploaded_file($tmp_name, $filename) ? 1 : 0;
...
According to the php documentation:
bool move_uploaded_file ( string $filename , string $destination )
This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.
0c6df86, a904bc1: Therefore, we add the -e move
options to the converter_wav_rate
bash script, since we need to watch for the audio files that php moves into the recording/
subdirectory.
We performed a bash automation via the web browser. Our recording audio.wav
was exactly 10.4025 seconds long:
After Reboot: The translation took under 2 minutes after sudo reboot
$ cd /var/www/audio-analyzer/audio/recording
$ ls -l
-rw-r--r-- 1 www-data www-data 458796 2014-07-13 10:12 audio.wav
$ (cd ../recording_converted && ls -l)
-rw-r--r-- 1 www-data www-data 332906 2014-07-13 10:12 audio.wav
$ (cd ../recording_text && ls -l)
-rw-r--r-- 1 root root 84 2014-07-13 10:14 audio
Repeat Without Reboot: We performed another recording, and saved the audio without sudo reboot
, and without removing any audio.wav
, or audio
files:
$ cd /var/www/audio-analyzer/audio/recording
$ ls -l
-rw-r--r-- 1 www-data www-data 352300 2014-07-13 10:24 audio.wav
$ (cd ../recording_converted && ls -l)
-rw-r--r-- 1 www-data www-data 255630 2014-07-13 10:24 audio.wav
$ (cd ../recording_text && ls -l)
-rw-r--r-- 1 root root 99 2014-07-13 10:27 audio
Performing above, that is saving an audio after sudo reboot
, then saving another audio immediately after without sudo reboot
produces a log that runs inotifywait
two times, once for each instance an audio recording was saved.
Bash automation does not proceed if we save an audio recording from the browser (no file is found in the
recording_converted/
subdirectory), despite its success from manually copying an audio file into the directory:So, we will adjust both
converter_wav_rate
, andconverter_wav_text
. This will involve changing:to the following: