https://github.com/malantin/java-ogg-to-ms-speech
This project demonstrates how use ffmpeg to convert .ogg files (Vorbis and Opus) to the right format for Speech-to-Text transcription using the Microsoft Cognitive Services Speech Service. One use is the transcription of WhatsApp voice messages retrieved through the WhatsApp Business API.
https://github.com/malantin/java-ogg-to-ms-speech
cognitive-services ffmpeg microsoft-speech-service ogg-files opus text-transcription whatsapp whatsapp-api whatsapp-business
Last synced: 2 months ago
JSON representation
This project demonstrates how use ffmpeg to convert .ogg files (Vorbis and Opus) to the right format for Speech-to-Text transcription using the Microsoft Cognitive Services Speech Service. One use is the transcription of WhatsApp voice messages retrieved through the WhatsApp Business API.
- Host: GitHub
- URL: https://github.com/malantin/java-ogg-to-ms-speech
- Owner: malantin
- License: mit
- Created: 2019-09-17T20:27:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-05T13:43:43.000Z (over 5 years ago)
- Last Synced: 2025-01-21T06:29:18.858Z (4 months ago)
- Topics: cognitive-services, ffmpeg, microsoft-speech-service, ogg-files, opus, text-transcription, whatsapp, whatsapp-api, whatsapp-business
- Language: Java
- Homepage:
- Size: 12.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Transcribe .ogg speech files with the Microsoft Speech Java SDK
This project demonstrates how use ffmpeg to convert .ogg files (Vorbis and Opus) to the right format for Speech-to-Text transcription using the Microsoft Cognitive Services Speech Service. This could be used to transcribe voice messages encoded using the Opus (https://en.wikipedia.org/wiki/Opus_(audio_format)) codec or other codecs using the .ogg container format.One use for this project is the transcription of WhatsApp voice messages received through the [WhatsApp Business API](https://www.whatsapp.com/business/api)
To make this sample work, you need the [Cognitive Services Speech Service Java SDK](https://docs.microsoft.com/en-us/java/api/com.microsoft.cognitiveservices.speech?view=azure-java-stable) which has been already added to the pom file.
```java
public final static String MS_SPEECH_KEY = "your-microsoft-speech-key";
public final static String MS_SPEECH_REGION = "westeurope";
public final static String MS_SPEECH_RECOGNITION_LANG = "de-de";
```You also need to download [ffmpeg](https://ffmpeg.org/) which is used for transcoding and set the right path to it in the source. An audio file can be read from disk or passed as a byte array. It will then, in memory, be transcoded to wav / pcm format for transcription using the Cognitive Services Speech Service.
Also check out the [Microsoft Speech SDK Sample Repository](https://github.com/Azure-Samples/cognitive-services-speech-sdk) to learn more and use more of it's functionality.
Thank you [@chgeuer](https://github.com/chgeuer) for your contributions.