diff options
author | Urs Fleisch <ufleisch@users.sourceforge.net> | 2021-01-01 11:48:06 +0100 |
---|---|---|
committer | Urs Fleisch <ufleisch@users.sourceforge.net> | 2021-01-01 11:48:06 +0100 |
commit | 1a2e1d08ac607b6af94041a215c9dbc08c9477b1 (patch) | |
tree | bf21c3d99a322c80f98c1a922eddfc265ee113aa /tests | |
parent | 3f3b48353ccc10e916c1c91dce3c36b72531c544 (diff) | |
parent | 1332d44ff6d5b769d21a63c156e501f735e5ca5b (diff) |
Merge pull request #986 from ufleisch/ufleisch/wav-extensible-subformat
WAV: Support subformat in WAVE_FORMAT_EXTENSIBLE (#850)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/uint8we.wav | bin | 0 -> 47240 bytes | |||
-rw-r--r-- | tests/test_wav.cpp | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/data/uint8we.wav b/tests/data/uint8we.wav Binary files differnew file mode 100644 index 00000000..9623db22 --- /dev/null +++ b/tests/data/uint8we.wav diff --git a/tests/test_wav.cpp b/tests/test_wav.cpp index 59484443..61081393 100644 --- a/tests/test_wav.cpp +++ b/tests/test_wav.cpp @@ -57,6 +57,7 @@ class TestWAV : public CppUnit::TestFixture CPPUNIT_TEST(testFileWithGarbageAppended); CPPUNIT_TEST(testStripAndProperties); CPPUNIT_TEST(testPCMWithFactChunk); + CPPUNIT_TEST(testWaveFormatExtensible); CPPUNIT_TEST_SUITE_END(); public: @@ -369,6 +370,20 @@ public: CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->format()); } + void testWaveFormatExtensible() + { + RIFF::WAV::File f(TEST_FILE_PATH_C("uint8we.wav")); + CPPUNIT_ASSERT(f.audioProperties()); + CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->lengthInSeconds()); + CPPUNIT_ASSERT_EQUAL(2937, f.audioProperties()->lengthInMilliseconds()); + CPPUNIT_ASSERT_EQUAL(128, f.audioProperties()->bitrate()); + CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels()); + CPPUNIT_ASSERT_EQUAL(8000, f.audioProperties()->sampleRate()); + CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->bitsPerSample()); + CPPUNIT_ASSERT_EQUAL(23493U, f.audioProperties()->sampleFrames()); + CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->format()); + } + }; CPPUNIT_TEST_SUITE_REGISTRATION(TestWAV); |