mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 05:24:25 -04:00
Ogg Opus: AudioProperties improvements
Add lengthInSeconds(), lengthInMilliseconds() properties. (#503) Remove some data members which are not needed to carry. Add some tests for audio properties. Add some supplementary comments.
This commit is contained in:
@ -12,21 +12,25 @@ using namespace TagLib;
|
||||
class TestOpus : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestOpus);
|
||||
CPPUNIT_TEST(testProperties);
|
||||
CPPUNIT_TEST(testAudioProperties);
|
||||
CPPUNIT_TEST(testReadComments);
|
||||
CPPUNIT_TEST(testWriteComments);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
|
||||
void testProperties()
|
||||
void testAudioProperties()
|
||||
{
|
||||
Ogg::Opus::File f(TEST_FILE_PATH_C("correctness_gain_silent_output.opus"));
|
||||
CPPUNIT_ASSERT(f.audioProperties());
|
||||
CPPUNIT_ASSERT_EQUAL(7, f.audioProperties()->length());
|
||||
CPPUNIT_ASSERT_EQUAL(41, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(7, f.audioProperties()->lengthInSeconds());
|
||||
CPPUNIT_ASSERT_EQUAL(7737, f.audioProperties()->lengthInMilliseconds());
|
||||
CPPUNIT_ASSERT_EQUAL(37, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(48000, f.audioProperties()->sampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(48000, ((Ogg::Opus::Properties *)f.audioProperties())->inputSampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(48000, f.audioProperties()->inputSampleRate());
|
||||
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->opusVersion());
|
||||
}
|
||||
|
||||
void testReadComments()
|
||||
|
Reference in New Issue
Block a user