spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 98aa9904ef6b0922cce98dda0d756a71dc4b10fa
parent 79ae75a7b0477d111c24de78f38940fb3c6ca4da
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Fri,  1 Mar 2013 20:46:36 -0800

Add mp3 demuxing tests

Diffstat:
Mpo/spek.pot | 28++++++++++++++--------------
Msrc/spek-pipeline.cc | 1-
Atests/samples/2ch-44100Hz-128cbr.mp3 | 0
Atests/samples/2ch-44100Hz-320cbr.mp3 | 0
Atests/samples/2ch-44100Hz-V0.mp3 | 0
Atests/samples/2ch-44100Hz-V2.mp3 | 0
Mtests/test-audio-info.cc | 12+++++++++---
7 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/po/spek.pot b/po/spek.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-23 20:00-0800\n" +"POT-Creation-Date: 2013-03-01 20:01-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -34,64 +34,64 @@ msgstr "" msgid "View spectrograms of your audio files" msgstr "" -#: ../src/spek-pipeline.cc:201 +#: ../src/spek-pipeline.cc:199 #, c-format msgid "%d kbps" msgstr "" -#: ../src/spek-pipeline.cc:206 +#: ../src/spek-pipeline.cc:204 #, c-format msgid "%d Hz" msgstr "" -#: ../src/spek-pipeline.cc:213 +#: ../src/spek-pipeline.cc:211 #, c-format msgid "%d bit" msgid_plural "%d bits" msgstr[0] "" msgstr[1] "" -#: ../src/spek-pipeline.cc:221 +#: ../src/spek-pipeline.cc:219 #, c-format msgid "%d channel" msgid_plural "%d channels" msgstr[0] "" msgstr[1] "" -#: ../src/spek-pipeline.cc:238 +#: ../src/spek-pipeline.cc:236 msgid "Cannot open input file" msgstr "" -#: ../src/spek-pipeline.cc:241 +#: ../src/spek-pipeline.cc:239 msgid "Cannot find stream info" msgstr "" -#: ../src/spek-pipeline.cc:244 +#: ../src/spek-pipeline.cc:242 msgid "The file contains no audio streams" msgstr "" -#: ../src/spek-pipeline.cc:247 +#: ../src/spek-pipeline.cc:245 msgid "Cannot find decoder" msgstr "" -#: ../src/spek-pipeline.cc:250 +#: ../src/spek-pipeline.cc:248 msgid "Unknown duration" msgstr "" -#: ../src/spek-pipeline.cc:253 +#: ../src/spek-pipeline.cc:251 msgid "No audio channels" msgstr "" -#: ../src/spek-pipeline.cc:256 +#: ../src/spek-pipeline.cc:254 msgid "Cannot open decoder" msgstr "" -#: ../src/spek-pipeline.cc:259 +#: ../src/spek-pipeline.cc:257 msgid "Unsupported sample format" msgstr "" #. TRANSLATORS: first %s is the error message, second %s is stream description. -#: ../src/spek-pipeline.cc:271 +#: ../src/spek-pipeline.cc:269 #, c-format msgid "%s: %s" msgstr "" diff --git a/src/spek-pipeline.cc b/src/spek-pipeline.cc @@ -23,7 +23,6 @@ * (c) 2007-2009 Sebastian Dröge <sebastian.droege@collabora.co.uk> */ -#define __STDC_LIMIT_MACROS #include <wx/intl.h> #include <assert.h> diff --git a/tests/samples/2ch-44100Hz-128cbr.mp3 b/tests/samples/2ch-44100Hz-128cbr.mp3 Binary files differ. diff --git a/tests/samples/2ch-44100Hz-320cbr.mp3 b/tests/samples/2ch-44100Hz-320cbr.mp3 Binary files differ. diff --git a/tests/samples/2ch-44100Hz-V0.mp3 b/tests/samples/2ch-44100Hz-V0.mp3 Binary files differ. diff --git a/tests/samples/2ch-44100Hz-V2.mp3 b/tests/samples/2ch-44100Hz-V2.mp3 Binary files differ. diff --git a/tests/test-audio-info.cc b/tests/test-audio-info.cc @@ -47,10 +47,16 @@ 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 + 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} }, + {"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}}, }; for (const auto& item : files) { run([&] () { test_file(item.first, item.second); }, "audio info: " + item.first);