felixjunghans / google_speech

Flutter google spech
MIT License
68 stars 41 forks source link

AudioRecognizeState #33

Closed akhilgorantala closed 1 year ago

akhilgorantala commented 1 year ago

I/AudioRecord(18421): start(5206): return status 0 E/flutter (18421): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected end of input (at character 1) E/flutter (18421): E/flutter (18421): ^ E/flutter (18421): E/flutter (18421): #0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5) E/flutter (18421): #1 _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:501:7) E/flutter (18421): #2 _parseJson (dart:convert-patch/convert_patch.dart:36:10) E/flutter (18421): #3 JsonDecoder.convert (dart:convert/json.dart:610:36) E/flutter (18421): #4 JsonCodec.decode (dart:convert/json.dart:216:41) E/flutter (18421): #5 jsonDecode (dart:convert/json.dart:155:10) E/flutter (18421): #6 new ServiceAccountAuthenticator (package:grpc/src/auth/authio.dart:30:11) E/flutter (18421): #7 new ServiceAccount. (package:google_speech/speech_client_authenticator.dart:35:26) E/flutter (18421): #8 new ServiceAccount.fromString (package:google_speech/speech_client_authenticator.dart:73:27) E/flutter (18421): #9 _AudioRecognizeState.streamingRecognize (package:untitled4/main.dart:64:43) E/flutter (18421): E/flutter (18421): D/AudioRecordExtImpl(18421): setAudioBoostTid D/AudioRecordExtImpl(18421): has setAudioBoostTid D/AudioRecordExtImpl(18421): setAudioReadBoostTid

felixjunghans commented 1 year ago

Looks like your serviceaccount.json file is not in the correct format or not valid json

akhilgorantala commented 1 year ago

do we need to keep it empty or ? do we need to add some type of data in there ?

felixjunghans commented 1 year ago

Please read the ReadMe. There is a detailed description of how to create a service account to use the Google Speech Api. You can also read the Google Documentation https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries