mirror of
				https://github.com/taglib/taglib.git
				synced 2025-10-31 07:46:22 -04:00 
			
		
		
		
	WAV: Test properties of file with WAVE_FORMAT_EXTENSIBLE
uint8we.wav: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples/AFsp/M1F1-uint8WE-AFsp.wav
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								tests/data/uint8we.wav
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								tests/data/uint8we.wav
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -52,6 +52,7 @@ class TestWAV : public CppUnit::TestFixture | ||||
|   CPPUNIT_TEST(testFuzzedFile2); | ||||
|   CPPUNIT_TEST(testStripAndProperties); | ||||
|   CPPUNIT_TEST(testPCMWithFactChunk); | ||||
|   CPPUNIT_TEST(testWaveFormatExtensible); | ||||
|   CPPUNIT_TEST_SUITE_END(); | ||||
|  | ||||
| public: | ||||
| @ -305,6 +306,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); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user