mirror of
https://github.com/alexkay/spek.git
synced 2025-04-16 16:42:19 +03:00
Check only the start of the the codec name
This commit is contained in:
parent
fa94bf0bf6
commit
9e7c6156b9
@ -37,7 +37,9 @@ static void test_file(const std::string& name, const FileInfo& info)
|
||||
Audio audio;
|
||||
auto file = audio.open(SAMPLES_DIR "/" + name);
|
||||
test("error", AudioError::OK, file->get_error());
|
||||
test("codec", info.codec_name, file->get_codec_name());
|
||||
test(file->get_codec_name(), true, !file->get_codec_name().compare(
|
||||
0, info.codec_name.length(), info.codec_name
|
||||
));
|
||||
test("bit rate", info.bit_rate, file->get_bit_rate());
|
||||
test("sample rate", info.sample_rate, file->get_sample_rate());
|
||||
test("bps", info.bits_per_sample, file->get_bits_per_sample());
|
||||
@ -50,13 +52,13 @@ void test_audio_info()
|
||||
const double MP3_T = 5.0 * 1152 / 44100; // 5 frames * duration per mp3 frame
|
||||
|
||||
std::map<std::string, FileInfo> files = {
|
||||
{"1ch-96000Hz-24bps.flac", {"FLAC (Free Lossless Audio Codec)", 0, 96000, 24, 1, 0.1}},
|
||||
{"2ch-48000Hz-16bps.flac", {"FLAC (Free Lossless Audio Codec)", 0, 48000, 16, 2, 0.1}},
|
||||
{"2ch-44100Hz-16bps.wav", {"PCM signed 16-bit little-endian", 0, 44100, 16, 2, 0.1}},
|
||||
{"2ch-44100Hz-128cbr.mp3", {"MP3 (MPEG audio layer 3)", 128000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-320cbr.mp3", {"MP3 (MPEG audio layer 3)", 320000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-V0.mp3", {"MP3 (MPEG audio layer 3)", 112000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-V2.mp3", {"MP3 (MPEG audio layer 3)", 64000, 44100, 0, 2, MP3_T}},
|
||||
{"1ch-96000Hz-24bps.flac", {"FLAC", 0, 96000, 24, 1, 0.1}},
|
||||
{"2ch-48000Hz-16bps.flac", {"FLAC", 0, 48000, 16, 2, 0.1}},
|
||||
{"2ch-44100Hz-16bps.wav", {"PCM", 0, 44100, 16, 2, 0.1}},
|
||||
{"2ch-44100Hz-128cbr.mp3", {"MP3", 128000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-320cbr.mp3", {"MP3", 320000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-V0.mp3", {"MP3", 112000, 44100, 0, 2, MP3_T}},
|
||||
{"2ch-44100Hz-V2.mp3", {"MP3", 64000, 44100, 0, 2, MP3_T}},
|
||||
};
|
||||
for (const auto& item : files) {
|
||||
run(
|
||||
|
Loading…
x
Reference in New Issue
Block a user