.m4a被视为音频/ m4a或音频/ mp4

Bro*_*sef 5 audio core-audio ios

我正在尝试将音频上传到S3,我有点困惑我应该将我的mime类型声明为。我的音频文件是在iPhone上以录制的m4a kAudioFormatMPEG4AAC。这会被视为audio/m4aaudio/mp4?我在网上看到矛盾的答案。

twh*_*whb 17

使用audio/mp4. audio/m4a可能有效,但无效。

MP4 MIME 类型注册

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.
Run Code Online (Sandbox Code Playgroud)

此外,标准 MIME 类型列表包括audio/mp4、notaudio/m4a和非标准 MIME 类型应包括“x-”,如audio/x-m4a


Tim*_*Tim 7

m4m4a是短手MPEG-4,就像mp4是短手MPEG-4

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

音频的编解码器也可以是,尽管使用相同的文件扩展名,例如两个不同的alacAAC格式采用MPEG-4容器格式与所述m4a文件扩展名。

因此,回答您的问题,实际上并没有多大区别。我个人的喜好是audio/mp4因为那实际上是在说

MPEG-4容器中的音频数据

然而,audio/m4a就像说

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

  • `audio/m4a` 是错误的。请参阅[twhb的答案](/sf/answers/4098598731/)。iOS 不会将其识别为“UTType(mimeType: "audio/m4a").conforms(to: .audio) == false”。 (2认同)