APE: Use the audio stream length in calculating the bit rate.

This commit is contained in:
Tsuda Kageyu
2015-05-26 10:12:29 +09:00
parent 9a8e41b9d6
commit 125d887b85
3 changed files with 27 additions and 1 deletions

Binary file not shown.

View File

@ -14,6 +14,7 @@ class TestAPE : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestAPE);
CPPUNIT_TEST(testProperties399);
CPPUNIT_TEST(testProperties399Tagged);
CPPUNIT_TEST(testProperties396);
CPPUNIT_TEST(testProperties390);
CPPUNIT_TEST(testFuzzedFile1);
@ -37,6 +38,21 @@ public:
CPPUNIT_ASSERT_EQUAL(3990, f.audioProperties()->version());
}
void testProperties399Tagged()
{
APE::File f(TEST_FILE_PATH_C("mac-399-tagged.ape"));
CPPUNIT_ASSERT(f.audioProperties());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->lengthInSeconds());
CPPUNIT_ASSERT_EQUAL(3550, f.audioProperties()->lengthInMilliseconds());
CPPUNIT_ASSERT_EQUAL(192, f.audioProperties()->bitrate());
CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
CPPUNIT_ASSERT_EQUAL(16, f.audioProperties()->bitsPerSample());
CPPUNIT_ASSERT_EQUAL(156556U, f.audioProperties()->sampleFrames());
CPPUNIT_ASSERT_EQUAL(3990, f.audioProperties()->version());
}
void testProperties396()
{
APE::File f(TEST_FILE_PATH_C("mac-396.ape"));