cesine/tea-mates — Issue #2: Automatically transcode audio to mp3
Author: cesine
Created: 2011-11-16 18:28:17+00:00
State: open

Currently the app is running the audio straight.

I tested with wav and amr. I would like to run it throuhg ffmpeg to be sure that it is mp3 before processing it.

Here is the output:
File 1: a sample mp3, works great
File 2: a wav recorded on a laptop, says unsupported file type
File 3: a amr recorded on an android phone, runs for a long time without saying antyhing

It gave an unsupported filetype error for an .wav

and locked on a longer .mp3

here is the log:

539.mp3 /home/gina/Downloads/tea-mates/audio/1.mp3
/home/gina/Downloads/tea-mates/lib:mp3splt -N -s -p th=-30,rm /home/gina/Downloads/tea-mates/audio/1.mp3
Processing file '/home/gina/Downloads/tea-mates/audio/1.mp3' ...
info: file matches the plugin 'mp3 (libmad)'
info: MPEG 2 Layer 3 - 16000 Hz - Mono - FRAME MODE - Total time: 0m.10s
info: starting silence mode split
Silence split type: Auto mode (Th: -30.0 dB, Off: 0.80, Min: 0.00, Remove: YES, Min track: 0.00)

Total silence points found: 0.
no silence splitpoints found
Average silence level: -21.14 dB

/home/gina/Downloads/tea-mates/lib:sox /home/gina/Downloads/tea-mates/audio/1.mp3 /home/gina/Downloads/tea-mates/audio/1.flac gain -n -5 silence 1 5 2%
curl --data-binary @/home/gina/Downloads/tea-mates/audio/1.flac --header 'Content-type: audio/x-flac; rate=16000' 'https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&pfilter=2&lang=en-US&maxresults=6'
{"status":0,"id":"32569661f8641bc2e50f0922efbdbc54-1","hypotheses":[{"utterance":"popular because we haven't talked in forever so many things to do","confidence":0.57357055},{"utterance":"popular because we haven't talked in forever so you think of something out"},{"utterance":"popular because we haven't talked in forever so you think of something out to do"},{"utterance":"popular because we haven't talked in forever so you think of the hell to do"},{"utterance":"because we haven't talked in forever so many things to do"},{"utterance":"because we haven't talked in forever so you think of something out"}]}

popular because we haven't talked in forever so many things to do
2011-11-16 13:16:12.575 DEBUG main:52 -
uploaded %s to %s'sample_recorded_in_praat_using_laptop_mic_outdoors_wav.wav''/tmp/8371d1b58bf31e7a94ec97aa221724bb.wav'
2011-11-16 13:16:25.874 DEBUG main:52 -
uploaded %s to %s'sample_recorded_on_android_handset_outdoors.mp3''/tmp/573f40b1dd725fea962487c5bdbd5656.mp3'
2011-11-16 13:16:25.876 DEBUG main:68 - counter:2
2011-11-16 13:16:25.877 DEBUG main:69 - 2
2011-11-16 13:16:25.878 DEBUG main:76 - cmd:mv /tmp/573f40b1dd725fea962487c5bdbd5656.mp3 /home/gina/Downloads/tea-mates/audio/2.mp3
/home/gina/Downloads/tea-mates/lib:mp3splt -N -s -p th=-30,rm /home/gina/Downloads/tea-mates/audio/2.mp3
{"stack":"Error: Command failed: mp3splt 2.4.1 (14/11/11) - using libmp3splt 0.7.1\n\tMatteo Trotta \n\tAlexandru Munteanu \nTHIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!\n error: no plugin matches the file '/home/gina/Downloads/tea-mates/audio/2.mp3'\n\n at ChildProcess.exithandler (child_process.js:102:15)\n at ChildProcess.emit (events.js:67:17)\n at ChildProcess.onexit (child_process.js:192:12)","message":"Command failed: mp3splt 2.4.1 (14/11/11) - using libmp3splt 0.7.1\n\tMatteo Trotta \n\tAlexandru Munteanu \nTHIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!\n error: no plugin matches the file '/home/gina/Downloads/tea-mates/audio/2.mp3'\n","killed":false,"code":1,"signal":null}
2011-11-16 13:18:25.919 DEBUG main:52 -
uploaded %s to %s'sample_recorded_on_android_handset_outdoors.mp3''/tmp/fcb683d41113b2c1a9df67e97b983c14.mp3'
2011-11-16 13:18:25.921 DEBUG main:68 - counter:3
2011-11-16 13:18:25.922 DEBUG main:69 - 3
2011-11-16 13:18:25.924 DEBUG main:76 - cmd:mv /tmp/fcb683d41113b2c1a9df67e97b983c14.mp3 /home/gina/Downloads/tea-mates/audio/3.mp3
/home/gina/Downloads/tea-mates/lib:mp3splt -N -s -p th=-30,rm /home/gina/Downloads/tea-mates/audio/3.mp3
{"stack":"Error: Command failed: mp3splt 2.4.1 (14/11/11) - using libmp3splt 0.7.1\n\tMatteo Trotta \n\tAlexandru Munteanu \nTHIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!\n error: no plugin matches the file '/home/gina/Downloads/tea-mates/audio/3.mp3'\n\n at ChildProcess.exithandler (child_process.js:102:15)\n at ChildProcess.emit (events.js:67:17)\n at ChildProcess.onexit (child_process.js:192:12)","message":"Command failed: mp3splt 2.4.1 (14/11/11) - using libmp3splt 0.7.1\n\tMatteo Trotta \n\tAlexandru Munteanu \nTHIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!\n error: no plugin matches the file '/home/gina/Downloads/tea-mates/audio/3.mp3'\n","killed":false,"code":1,"signal":null}