MP3 Content Type for Creating a MediaSource

Marc George 21 Reputation points
2020-08-29T00:21:35.09+00:00

I am using Azure SSML TTS to get a C# Stream object in "audio-16khz-64kbitrate-mono-mp3" format and other customizations. I subsequently create a byte[] stream from it for cross-platform Xamarin distribution. For UWP I convert it to a InMemoryRandomAccessStream to use with CreateFromStream to create a MediaPlayer.Source from a mediaPlaybackItem.

Using MediaSource.CreateFromStream(stream, content type), what is the content type for a "audio-16khz-64kbitrate-mono-mp3" stream? I have tried numerous values which result in the mediasource not being created.

I have also tried using stream.AsRandomAccessStream with the received stream to create the mediaPlaybackItem without using the byte stream approach with no success.

I know the stream is valid as it is not null and playable on Android devices.

21220-annotation-2020-08-27-203900.png

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,772 questions
Universal Windows Platform (UWP)
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,897 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.