Speec to text experimentation
This commit is contained in:
parent
c64664063f
commit
982e306301
6 changed files with 55 additions and 1 deletions
56
README.md
56
README.md
|
@ -1,2 +1,56 @@
|
|||
# azure-ai
|
||||
azure-ai
|
||||
============================
|
||||
|
||||
Azure AI playground and notes
|
||||
|
||||
# Speech to text
|
||||
|
||||
## Recording
|
||||
Recording directly from mic seems to work out of the box with very little debugging.
|
||||
|
||||

|
||||
|
||||
## Uploading yt-dlp extracted audio
|
||||
Tried to upload yt-dlp downloaded video audio for speech to text but was met with problems with audio format. Here's the steps I took:
|
||||
|
||||
1. yt-dlp [url]
|
||||
2. extract audio with ffmpeg `ffmpeg -i [file].webm -q:a 0 -map a [file].mp3`
|
||||
3. Upload mp3 failed
|
||||
4. Convert mp3 to wav via ffmpeg `ffmpeg -i quartering.webm.mp3 -acodec pcm_u8 -ar 22050 quartering.webm.wav`
|
||||
5. No dice
|
||||
6. Then tried exporting the audio via audacity
|
||||
7. Still the same error
|
||||
|
||||

|
||||
|
||||
### Seems to be very picky with file formatting
|
||||
|
||||
Based on this article https://www.unimelb.edu.au/accessibility/automatic-speech-recognition/getting-started-with-microsoft-azure-speech-to-text it seems that audio needs to be in a very specific format.
|
||||
|
||||
"The out of the box speech-to-text Service is available for quick real-time Speech-to-text service and transcription of WAV audio file(s) (16kHz or 8kHz, 16-bit, and mono PCM)."
|
||||
|
||||
By the way, official documentation is remarkably mum about this requirement.
|
||||
|
||||
Anyway, let's try converting again.
|
||||
|
||||
```bash
|
||||
ffmpeg -i q.mp3 -acodec pcm_s16le -ac 1 -ar 16000 q3.wav
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Language switching
|
||||
|
||||
Let's switch to Finnish and try this again.
|
||||
|
||||
As a source data we use a video in an article https://yle.fi/a/74-20080518. Audio
|
||||
is recorded with audacity and then exported as wav.
|
||||
|
||||

|
||||
|
||||
Finnish is notoriously difficult language to learn (or so I've heard) and my experiences with various translation solutions have left absolutely more to be desired. Here's the result of the small news clip.
|
||||
|
||||

|
||||
|
||||
I would say these results are amazing as far as accuracy is concerned in comparison to other solutions even fiveish years ago. Granted, I haven't had the need to do anything like this so maybe I am hyping over nothing but still, pretty good.
|
||||
|
||||
|
|
BIN
note-assets/speec-to-text-recording.png
Normal file
BIN
note-assets/speec-to-text-recording.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 161 KiB |
BIN
note-assets/speech-to-text-error-file-format.png
Normal file
BIN
note-assets/speech-to-text-error-file-format.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 163 KiB |
BIN
note-assets/speech-to-text-finnish-audacity.png
Normal file
BIN
note-assets/speech-to-text-finnish-audacity.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 254 KiB |
BIN
note-assets/speech-to-text-finnish-results.png
Normal file
BIN
note-assets/speech-to-text-finnish-results.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 420 KiB |
BIN
note-assets/speech-to-text-working-wav.png
Normal file
BIN
note-assets/speech-to-text-working-wav.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 254 KiB |
Loading…
Reference in a new issue