@@ -93,3 +93,33 @@ def testCheckVideoProperties():
93
93
assert_equals ( videoStream .getNbFrames (), expectedNbFrames )
94
94
assert_equals ( round (videoStream .getDuration (), 2 ), expectedDuration )
95
95
assert_equals ( videoStream .getFps (), expectedFps )
96
+
97
+ def testCheckAudioProperties ():
98
+ """
99
+ Check properties of an audio stream.
100
+ """
101
+ # get src file
102
+ inputFileName = os .environ ['AVTRANSCODER_TEST_AUDIO_WAVE_FILE' ]
103
+ inputFile = av .InputFile ( inputFileName )
104
+ properties = inputFile .getProperties ()
105
+ audioStream = properties .getAudioProperties ()[0 ]
106
+
107
+ expectedTotalBitRate = 4608040
108
+ expectedAudioBitRate = 4608000
109
+
110
+ expectedCodecName = 'pcm_s16le'
111
+ expectedSamples = 5760000
112
+ expectedDuration = 20
113
+ expectedChannels = 6
114
+ expectedChannelLayout = '5.1'
115
+ expectedSampleRate = 48000
116
+
117
+ assert_equals ( properties .getBitRate (), expectedTotalBitRate )
118
+ assert_equals ( audioStream .getBitRate (), expectedAudioBitRate )
119
+
120
+ assert_equals ( audioStream .getCodecName (), expectedCodecName )
121
+ assert_equals ( audioStream .getNbSamples (), expectedSamples )
122
+ assert_equals ( round (audioStream .getDuration (), 2 ), expectedDuration )
123
+ assert_equals ( audioStream .getChannels (), expectedChannels )
124
+ assert_equals ( audioStream .getChannelLayout (), expectedChannelLayout )
125
+ assert_equals ( audioStream .getSampleRate (), expectedSampleRate )
0 commit comments