question

JebMillion-4907 avatar image
0 Votes"
JebMillion-4907 asked timleyden-msft commented

How can we do language detection for audio url before performing speech to text of Cognitive services API?

Hello all,

I can use speech to text batch transcription api by providing single language as part of request body. I could also detect the audio language in prior for the audio files from my local directory and pass that to the request body.


But I want to detect the language from the audio url and pass that to the request body.

{
"contentUrls": [
"<URL to an audio file 1 to transcribe>"
],
"properties": {
"wordLevelTimestampsEnabled": true
},
"locale": [detected lang] ,
"model": {
"self": "https://westus.api.cognitive.microsoft.com/speechtotext/v3.0/models/{id}"
},
"displayName": "Transcription of file using default model for en-US"
}


Is there any way to do the same?



azure-cognitive-servicesazure-speechazure-language-understanding
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ramr-msft avatar image
1 Vote"
ramr-msft answered timleyden-msft commented

@JebMillion-4907 Thanks for the question. Language identification can be used to determine the language being spoken in audio that has been passed to the Speech SDK.

Please follow the document for sample using C#.
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-automatic-language-detection?pivots=programming-language-csharp

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JebMillion-4907 as far as I know the batch api does not support auto detection for locale from the file submitted. you would have to preprocess the file using something like the realtime speech sdk as already suggested and then use that to submit to the api. try using local storage for the realtime api instead of the azure storage container

1 Vote 1 ·

Thank you.
I tried with the python code given as per documentation. It's showing file not found error when I use audio url obtained from the audio stored in my azure container.

0 Votes 0 ·