音频文件格式与转换 Introduction on Audo File Format and Audio Converter

By | June 18, 2020

音频格式简介

音频文件格式专指存放音频数据的文件的格式。存在多种不同的格式。

一般获取音频数据的方法是:采用固定的时间间隔,对音频电压采样(量化),并将结果以某种分辨率(例如:CDDA每个采样为16比特或2字节)存储。采样的时间间隔可以有不同的标准,如CDDA采用每秒44100次;DVD采用每秒48000或96000次。因此,采样率,分辨率和声道数目(例如立体声为2声道)是音频文件格式的关键参数。

需要分清楚的是音频文件和编解码器不同。尽管一种音频文件格式可以支持多种编码,例如AVI文件格式,但多数的音频文件仅支持一种音频编码。

有两类主要的音频文件格式:

无损格式,例如WAV,FLAC,APE,ALAC,WavPack(WV)
有损格式,例如MP3,AAC,Ogg Vorbis,Opus

有损文件格式是基于声学心理学的模型,除去人类很难或根本听不到的声音,例如:一个音量很高的声音后面紧跟着一个音量很低的声音。MP3就属于这一类文件。

无损的音频格式(例如FLAC)压缩比大约是2:1,解压时不会产生数据/质量上的损失,解压产生的数据与未压缩的数据完全相同。如需要保证音乐的原始质量,应当选择无损音频编解码器。例如,用免费的FLAC无损音频编解码器你可以在一张DVD-R碟上存储相当于20张CD的音乐。

有损压缩应用很多,但在专业领域使用不多。有损压缩具有很大的压缩比,提供相对不错的声音质量。

值得注意的是,根据各流行音乐出版商及内容提供商的数据,FLAC是目前应用最广泛的无损音乐格式。FLAC(全称为 Free Lossless Audio Codec),中文直译为自由无损音频压缩编码(注:这里的“Free”指的是自由软件,而并不仅是免费)。FLAC是一款的自由音频压缩编码,其特点是可以对音频文件无损压缩。不同于其他有损压缩编码(如MP3 、AAC等),压缩后不会有任何音质损失,现在已被很多软件及硬件音频产品所支持。

音频格式转换教程

音频格式转换通常需要使用音频格式转换工具。一个合格的音频格式转换工具需要满足以下几点特性:

  1. 能够将多种常用的音频文件格式转换为指定的音频文件格式。源音频文件包括:MP3、WMA、FLAC等;目标音频文件包括:MP3、WMA、VOX、WAV、FLAC等。
  2. 能对转换为指定的音频文件格式的参数进行任意设置,参数包括
    • 频率(Frequency)kHz
    • 采样位(Sample)Bits
    • 声道(Channel):单声道(Mono),立体声(Stereo);
    • 支持批量转换,操作简单;
    • 开源免费

本文推荐以下几个开源免费的音频格式转换软件(可直接在Release中下载):

  • https://github.com/MattMcManis/Axiom
  • https://github.com/adrielcafe/AndroidAudioConverter
  • https://github.com/michaeltyson/TPAACAudioConverter
  • https://github.com/audiamus/AaxAudioConverter

 

Introduction to Audio Format

Audio file format refers to the format of the file storing audio data. There are many different formats. The general method to obtain audio data is to sample (quantify) the audio voltage at a fixed time interval and store the results at a certain resolution (for example, each sample of cdda is 16 bits or 2 bytes). The sampling interval can have different standards, such as 44100 times per second for cdda; DVD uses 48000 or 96000 times per second. Therefore, the sampling rate, resolution, and the number of channels (for example, stereo is 2 channels) are the key parameters of audio file format. What needs to be distinguished is that audio files are different from codecs. Although one audio file format can support multiple encodings, such as AVI file format, most audio files support only one audio encoding.

There are two main audio file formats:

  • Lossless formats such as WAV, FLAC, APE, alac, wavpack (WV)
  • Lossy formats, such as MP3, AAC, Ogg, Vorbis, Opus

The lossy file format is based on the model of acoustic psychology, which removes sounds that are difficult or impossible for humans to hear. For example, a high volume sound is followed by a low volume sound. Mp3 belongs to this kind of file.

The compression ratio of lossless audio format (such as FLAC) is about 2:1. There will be no loss of data/quality during decompression, and the data generated by decompression is exactly the same as that of uncompressed data. If you need to ensure the original quality of music, you should choose a lossless audio codec. For example, with the free FLAC lossless audio codec, you can store music equivalent to 20 CDs on a DVD-R disc.

Lossy compression is widely used, but it is rarely used in professional fields. Lossy compression has a large compression ratio and provides relatively good sound quality. It is worth noting that according to the data of popular music publishers and content providers, FLAC is the most widely used lossless music format at present. FLAC (full name: free lossless audio codec) is translated into free lossless audio compression coding in Chinese (Note: “free” here refers to free software, not only free). FLAC is a free audio compression coding, which is characterized by lossless compression of audio files. Unlike other lossy compression codes (such as MP3, AAC, etc.), there will be no sound quality loss after compression. Now it has been supported by many software and hardware audio products.

Free Audio Convertor / Tutorial

Audio format conversion usually requires the use of audio format conversion tools. A qualified audio format conversion tool needs to meet the following characteristics:

  1. It can convert a variety of common audio file formats into specified audio file formats. Source audio files include MP3, WMA, FLAC, etc; Target audio files include MP3, WMA, Vox, WAV, FLAC, etc.
  2. It can arbitrarily set the parameters converted to the specified audio file format, including
    • Frequency (kHz)
    • Sample bits
    • Channel: mono, stereo;
    • Support batch conversion, simple operation;
    • Open-source and free

This article recommends the following open source and free audio format conversion software (which can be downloaded directly in the release page):

  • https://github.com/MattMcManis/Axiom
  • https://github.com/adrielcafe/AndroidAudioConverter
  • https://github.com/michaeltyson/TPAACAudioConverter
  • https://github.com/audiamus/AaxAudioConverter