Hi ARUN JOSEPH
Hope you are doing well.
I apologize for the confusion. You are correct that the FromAudioFileInput
method is not a valid method in the Microsoft.CognitiveServices.Speech
NuGet package. The correct methods for reading audio data from a file are FromWavFileInput
and FromStreamInput
.
I apologize for any confusion my previous response may have caused. Thank you for bringing this to my attention.
You can use the AudioConfig.FromStreamInput
method to read audio data from a file in any supported format.
The AudioConfig.FromStreamInput
method is particularly useful for handling audio files in formats other than WAV, such as MP3. To use MP3 or other compressed formats, the Speech SDK relies on GStreamer to decode the audio.
To configure this:
- Install GStreamer on your system and ensure its binaries are added to your system's
PATH
. - Use the
AudioInputStream.CreatePullStream
orAudioInputStream.CreatePushStream
methods to set up a stream for the compressed audio. - Specify the audio format (e.g., MP3) using
AudioStreamFormat.GetCompressedFormat(AudioStreamContainerFormat.MP3)
.
For more information, please refer How to use compressed input audio
GitHub repository demonstrates the use of the Azure Cognitive Services Speech SDK.
If you continue to experience difficulties, please feel free to reach out and will escalate the issue to the appropriate team to ensure it is resolved promptly.
I hope this information helps. Thank you!