mirror of
https://github.com/alexkay/spek.git
synced 2025-04-15 16:20:33 +03:00
tests: AAC demuxing/decoding
This commit is contained in:
parent
7627ecbb7a
commit
b5fcfface1
@ -134,9 +134,12 @@ std::unique_ptr<AudioFile> Audio::open(const std::string& file_name)
|
||||
bits_per_sample = codec_context->bits_per_raw_sample;
|
||||
if (!bits_per_sample) {
|
||||
// APE uses bpcs, FLAC uses bprs.
|
||||
// TODO: old comment, verify
|
||||
bits_per_sample = codec_context->bits_per_coded_sample;
|
||||
}
|
||||
if (codec_context->codec_id == AV_CODEC_ID_AAC) {
|
||||
// AAC decoder sets both bps and bitrate.
|
||||
bits_per_sample = 0;
|
||||
}
|
||||
if (bits_per_sample) {
|
||||
bit_rate = 0;
|
||||
}
|
||||
|
BIN
tests/samples/2ch-44100Hz-q100.m4a
Normal file
BIN
tests/samples/2ch-44100Hz-q100.m4a
Normal file
Binary file not shown.
@ -50,6 +50,7 @@ static void test_file(const std::string& name, const FileInfo& info)
|
||||
void test_audio_info()
|
||||
{
|
||||
const double MP3_T = 5.0 * 1152 / 44100; // 5 frames * duration per mp3 frame
|
||||
const double M4A_T = (10240 + 628) / 2.0 / 44100;
|
||||
|
||||
std::map<std::string, FileInfo> files = {
|
||||
{"1ch-96000Hz-24bps.flac", {"FLAC", 0, 96000, 24, 1, 0.1}},
|
||||
@ -63,6 +64,7 @@ void test_audio_info()
|
||||
{"2ch-44100Hz-320cbr.mp3", {"MP3", 320000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-V0.mp3", {"MP3", 201329, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-V2.mp3", {"MP3", 150124, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-q100.m4a", {"AAC", 159649, 44100, 0, 2, M4A_T}},
|
||||
{"2ch-44100Hz-q5.ogg", {"Vorbis", 160000, 44100, 0, 2, 0.1}},
|
||||
};
|
||||
for (const auto& item : files) {
|
||||
|
@ -58,6 +58,7 @@ void test_audio_read()
|
||||
{"2ch-44100Hz-320cbr.mp3", 2 * 1152 * 4 + 94},
|
||||
{"2ch-44100Hz-V0.mp3", 2 * 1152 * 4 + 94},
|
||||
{"2ch-44100Hz-V2.mp3", 2 * 1152 * 4 + 94},
|
||||
{"2ch-44100Hz-q100.m4a", 10240},
|
||||
{"2ch-44100Hz-q5.ogg", 2 * 1024 * 4 + 1152},
|
||||
};
|
||||
for (const auto& item : files) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user