问题
I am trying to up-sampling an M4a file from 41000 to another non-standard sampling rate let's say 5000.
ffmpeg -i audio.wav -ar 5000 audio_.wav
This worked fine with wav files whoever it didn't work with m4a. Any ideas why?
If non-standard sampling rates don't work with AAC I need any documentation or reference for that.
回答1:
The set of available sampling frequencies is limited by AAC ADIF (Audio Data Interchange Format) and ADTS (Audio Data Transport Stream). So other rates just can't be encoded in AAC stream. Here are values for field sampling_frequency_index
form 8.1.1.2
in ISO/IEC 13818-7 standard:
About @slhck answer
According to ISO/IEC 13818-7 paragraph 8.2.3:
8.2.3 Decoding Process
Assuming that the start of a raw_data_block() is known, it can be decoded without any additional „transport-level“ information and produces 1024 audio samples per output channel. The sampling rate of the audio signal, as specified by the sampling_frequency_index, may be specified in a program_config_element() or it may be implied in the specific application domain. In the latter case, the sampling_frequency_index must be deduced in order for the bitstream to be parsed.
Since a given sampling frequency is associated with only one sampling frequency table, and since maximum flexibility is desired in the range of possible sampling frequencies, the following Table shall be used to associate an implied sampling frequency with the desired sampling frequency dependent tables.
This table is for sampling_frequency_index deduction. And standards (both ISO/IEC 13818-7 and ISO/IEC 14496-3) imply that encoding have been made with one of these fixed frequencies.
来源:https://stackoverflow.com/questions/58928995/can-non-standard-sampling-rates-be-used-with-aac-encoding