GeezerVison is showing github.com — .flac file plays fine, but the speech/transcribe.py returns empty JSON output · Issue #640 · GoogleCloudPlatform/python-docs-samples
.flac file plays fine, but the speech/transcribe.py returns empty JSON output #640DescriptionUsing sox I created a .flac file.
I'm able to "play" the file which yields the following output of which I can also hear the audio:
% ./play Clip1.flac
Clip1.flac:
File Size: 356k Bit Rate: 161k
Encoding: FLAC Info: Processed by SoX
Channels: 1 @ 16-bit
Samplerate: 16000Hz
Replaygain: off
Duration: 00:00:17.64
In:100% 00:00:17.64 [00:00:00.00] Out:847k [ -====|====- ] Hd:2.8 Clip:0
Done.
When I try to use the transcribe.py script on the same file, it returns an empty {} JSON output Activitychanged the title [-].flac file plays fine, but the transcribe.py returns empty JSON output[/-] [+].flac file plays fine, but the speech/transcribe.py returns empty JSON output[/+] on Nov 7, 2016puneith commented on Nov 7, 2016 Are you using the one under grpc/ or api-client/ ? jcastill0 commented on Nov 7, 2016 puneith commented on Nov 7, 2016 jcastill0 commented on Nov 8, 2016 I tried to figure out how to generate a proper FLAC file, but I can'f find a way to do so with sox.
I tried the following commands and although I can play them back with the play script, they still return an empty {} JSON output.
First, using the macos version of sox. it doesn't take FLAC or LINEAR16 as an encoding parameter.
So, I used the following commands to generate the .flac file:
% ./sox data/Clip1.wav --rate 16k --bits 16 --channels 1 data/Clip1.flac
./sox WARN wav: wave header missing extended part of fmt chunk
% ./play data/Clip1.flac
data/Clip1.flac:
File Size: 355k Bit Rate: 161k
Encoding: FLAC Info: Processed by SoX
Channels: 1 @ 16-bit
Samplerate: 16000Hz
Replaygain: off
Duration: 00:00:17.64
In:100% 00:00:17.64 [00:00:00.00] Out:847k [ -====|====- ] Hd:2.8 Clip:0
Done.
I also tried the following:
% ./sox data/Clip1.wav --rate 16k --bits 16 --channels 1 --encoding mu-law data/Clip1a.flac
% ./play data/Clip1a.flac
data/Clip1a.flac:
File Size: 356k Bit Rate: 161k
Encoding: FLAC Info: Processed by SoX
Channels: 1 @ 16-bit
Samplerate: 16000Hz
Replaygain: off
Duration: 00:00:17.64
In:100% 00:00:17.64 [00:00:00.00] Out:847k [ -====|====- ] Hd:2.8 Clip:0
Done.
Running the 2nd file on the transcribe.py yields the same resuls (empty JSON file) puneith commented on Nov 9, 2016 Can you send me the audio file? jcastill0 commented on Nov 9, 2016 puneith commented on Nov 10, 2016 So, I do get some transcription (Both sync and async). Its not complete though, but thats a different issue. Are you not seeing this output?
python api-client/transcribe_async.py Clip1.raw
{"name": "7080391486607377985"}
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
{"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse", "results": [{"alternatives": [{"confidence": 0.82116348, "transcript": "no Mom's going to do the turkey I get there"}]}]}
python api-client/transcribe.py input_files/Clip1.flac
{"results": [{"alternatives": [{"confidence": 0.77390969, "transcript": "no Mom's going to do the turkey I get there"}]}]} theacodes commented on Feb 28, 2017 (Closing due to inactivity, feel free to comment and we'll re-open)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|