Skip to content

Python Async dumps problem Speech API #588

Closed

Description

@Dellax8

Hi,
with the transcribe_async.py file i can't get my results back.
The only changes that i made in transcribe_async.py are:

  • Language
  • Raw file passed by uri.

The error is in print(json.dumps(response['response']['results']))
Python says that the error is the Key 'results'

I try to fix it, but i can't understand what is wrong in this program.
I hope you can help me.

Thanks

Activity

  1. theacodes commented on Oct 18, 2016

    @theacodes
    Contributor

    Hi @Dellax8 , can you try changing that line to print(json.dumps(response)) and sending us the output?

  2. puneith commented on Oct 18, 2016

    @puneith
    Contributor

    @Dellax8 Do you mean rest or grpc transcribe_async.py? Also can you let us know what language you changed it to?

  3. Dellax8 commented on Oct 19, 2016

    @Dellax8
    Author

    @jonparrott
    {"done": true, "metadata": {"lastUpdateTime": "2016-10-18T15:46:35.033374Z", "progressPercent": 100, "startTime": "2016-10-18T15:46:28.054832Z", "@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata"}, "name": "#NAME#", "response": {"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse"}}

    @puneith
    I Try with REST. Now i Try with grpc but i can't' understand what is wrong.
    The language is it-IT but i think that this is not the problem.

  4. Dellax8 commented on Oct 19, 2016

    @Dellax8
    Author

    with grpc transcribe_async.py i can't compile.

    there are errors in "
    from google.cloud.credentials import get_credentials
    from google.cloud.speech.v1beta1 import cloud_speech_pb2
    from google.longrunning import operations_grpc_pb2
    from grpc.beta import implementations"

    the errors are in the import part.
    I have installed the requirements by pip, but it's not working yet

  5. puneith commented on Oct 19, 2016

    @puneith
    Contributor

    @Dellax8 Can you paste the error you are getting?

  6. Dellax8 commented on Oct 20, 2016

    @Dellax8
    Author

    @puneith

    in grpc - i fix the import error, but the result is empty...
    in REST -
    print(json.dumps(response['response']['results']))
    KeyError: 'results'

  7. puneith commented on Oct 20, 2016

    @puneith
    Contributor

    Can you send me the audio file if you don't mind.

  8. Dellax8 commented on Oct 20, 2016

    @Dellax8
    Author

    the encoding was wrong
    I create a new file but it doesn't work

    This is the audio Raw File

    teone2.zip

  9. jerjou commented on Oct 21, 2016

    @jerjou
    Contributor

    Hello - note that if you have encoded the file with different parameters than the sample one, you'll have to change the configuration parameters you send to the API. In this case, it looks like your audio file was encoded with a sample rate near 32000, which means you'll have to change the sampleRate parameter to match.

    I was able to get at least a partial result from the API after changing the sampleRate and language parameters, though I wasn't able to verify since I don't speak italian :) Anyway, based on that I believe this should resolve this issue - please reopen this issue if it doesn't!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions