GoogleCloudPlatform / GoogleCloudPlatform/firebase-extensions
[speech-to-text] API generates invalid JSON transcription
- Dominant language
- TypeScript
- Stars
- 124
- Forks
- 67
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 5
Description
### [REQUIRED] Step 2: Describe your configuration
- Extension name: **\_** `speech-to-text`
- Extension version: **\_** `googlecloud/speech-to-text@0.1.6 (slightly modified)`
- Configuration values (redact info where appropriate):
- **\_** `language code is en-US`
- **\_** The modified `index.js`:
https://gitlab.com/nevinchanyik/RED/-/blob/main/RED/GoogleCloudAPI/index.js?ref_type=heads
- **\_** The modified `transcribe-audio.js`:
https://gitlab.com/nevinchanyik/RED/-/blob/main/RED/GoogleCloudAPI/transcribe-audio.js?ref_type=heads
- **\_** The link to the .m4a audio file that needs to be transcribed:
https://firebasestorage.googleapis.com/v0/b/red-speech-to-text.firebasestorage.app/o/en-US%2FWt4XTR1eEodQYRBDkokFEBXJzNr1%2FWt4XTR1eEodQYRBDkokFEBXJzNr1-769399928.814137.m4a?alt=media&token=862e7332-1e7e-41ce-96e1-6cb507d7b677
- **\_** The link to the .txt transcription file:
https://firebasestorage.googleapis.com/v0/b/red-speech-to-text.firebasestorage.app/o/en-US%2FWt4XTR1eEodQYRBDkokFEBXJzNr1%2FWt4XTR1eEodQYRBDkokFEBXJzNr1-769399928.814137.m4a.wav_transcription.txt?alt=media&token=92dd3535-886c-4559-81d4-7637ce25e5c3
### [REQUIRED] Step 3: Describe the problem
#### Steps to reproduce:
1. Upload the .m4a example audio file to a storage in the path such as: {lang_code}/{user_id}/audio.m4a
2. Wait for the transcription and check the result – it produces invalid JSON, which I cannot parse on the iOS app not with JSONDecoder, not with JSONSerialization.
##### Expected result
API generates a valid JSON transcription.
##### Actual result
iOS (Swift) cannot decode the invalid JSON file. I think this `{}` in the empty array might be the reason:
```
, {
"alternatives": [ {
} ],
"languageCode": "en-us",
"resultEndTime": "221.340s"
},
```
Contributor guide
Assessment
This issue has not been assessed yet.