简体   繁体   English

用于创建媒体源的 MP3 内容类型

[英]MP3 Content Type for Creating a MediaSource

Using MediaSource.CreateFromStream(stream, content type), what is the content type for a "audio-16khz-64kbitrate-mono-mp3" stream?使用 MediaSource.CreateFromStream(stream, content type),“audio-16khz-64kbitrate-mono-mp3”流的内容类型是什么? I have tried numerous values which result in the mediasource not being created.我尝试了许多导致媒体源未被创建的值。

在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明

应该是其中之一

  • audio/mpeg
  • audio/x-mpeg
  • audio/mp3
  • audio/x-mp3

The current 'contentType' parameter value needed for MediaSource.CreateFromStream for the provided stream is not one of the 'audio/xxx' type specifications (it has been "audio/wav" for years in my code), but "{Name = "MemoryStream" FullName = "System.IO.MemoryStream"}" [with enclosing curly brackets].提供的流的 MediaSource.CreateFromStream 所需的当前“contentType”参数值不是“audio/xxx”类型规范之一(在我的代码中多年来一直是“audio/wav”),而是“{Name =” MemoryStream" FullName = "System.IO.MemoryStream"}" [用大括号括起来]。 This is the value is returned by "stream.GetType()"这是“stream.GetType()”返回的值

It is also important to know that the stream received, when assigned to a variable, has its property ".position" set to the length of the stream and needs to be reset to zero to be read.同样重要的是要知道接收到的流,当分配给一个变量时,其属性“.position”设置为流的长度,需要重置为零才能读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM