.m4a被视为audio / m4a或audio / mp4

时间:2016-10-06 00:37:53

标签: ios audio core-audio

我试图将音频上传到S3,我有点困惑我应该声明我的mime类型。我的音频文件是在iphone上记录为kAudioFormatMPEG4AAC的m4a。这会被视为audio/m4a还是audio/mp4?我在网上看到了相互矛盾的答案。

3 个答案:

答案 0 :(得分:4)

m4中的m4aMPEG-4的简称,就像mp4MPEG-4的简称。

事实上,m4am4vmp4文件都具有相同的内部MPEG-4原子结构。文件之间的区别在于它们的内容(视频文件包含视频原子和音频原子。)

尽管使用相同的文件扩展名,音频的编解码器也可能不同,例如,alacAAC格式都使用MPEG-4容器格式和m4a文件扩展名。

所以回答你的问题,它确实没有多大区别。我个人的偏好是audio/mp4,因为这实际上是在说

  

MPEG-4容器中的音频数据

然而,audio/m4a就像在说

  

包含音频的MPEG-4容器中的音频数据

答案 1 :(得分:0)

使用audio/mp4audio/m4a可能有效,但是无效。

MP4 MIME type registration

2.  Selection of MIME Types for MP4 Files

   The MIME types to be assigned to MP4 files are selected according to
   the contents.  Basic guidelines for selecting MIME types are as
   follows:

   a) if the file contains neither visual nor audio presentations, but
      only, for example, MPEG-J or MPEG-7, use application/mp4;

   b) for all other files, including those that have MPEG-J, etc., in
      addition to video or audio streams, video/mp4 should be used;
      however:

   c) for files with audio but no visual aspect, including those that
      have MPEG-J, etc., in addition to audio streams, audio/mp4 may be
      used.

   In any case, these indicate files conforming to the "MP4"
   specification, ISO/IEC 14496-1:2000, systems file format.

此外,the list of standard MIME types包含audio/mp4,而不是audio/m4a,非标准MIME类型应包含“ x-”,例如audio/x-m4a

答案 2 :(得分:0)

对我来说,2021 年 audio/mp4.m4a 文件适用于 Firefox + Chrome (Linux)、Opera (Android),但不适用于 iPhone Safari。对于某些格式,操作系统由于编解码器而发挥作用。 我使用了类型属性设置为 的源标记,并且还在流式/下载文件的 Content-Type 标头中设置了相同的类型

另见:How to play .m4a with HTML5 audio in IE(9+) and Safari (Pad)?