4343 needs_cuda ,
4444 needs_ffmpeg_cli ,
4545 psnr ,
46- SINE_16_CHANNELS ,
46+ SINE_16_CHANNEL_S16 ,
4747 SINE_MONO_S16 ,
4848 SINE_MONO_S32 ,
4949 SINE_MONO_S32_44100 ,
@@ -1791,7 +1791,9 @@ def test_cpu_fallback_no_fallback_on_supported_video(self, device):
17911791
17921792
17931793class TestAudioDecoder :
1794- @pytest .mark .parametrize ("asset" , (NASA_AUDIO , NASA_AUDIO_MP3 , SINE_MONO_S32 ))
1794+ @pytest .mark .parametrize (
1795+ "asset" , (NASA_AUDIO , NASA_AUDIO_MP3 , SINE_MONO_S32 , SINE_16_CHANNEL_S16 )
1796+ )
17951797 def test_metadata (self , asset ):
17961798 decoder = AudioDecoder (asset .path )
17971799 assert isinstance (decoder .metadata , AudioStreamMetadata )
@@ -1849,7 +1851,7 @@ def test_get_all_samples_with_range(self, asset, stop_seconds):
18491851 assert samples .sample_rate == asset .sample_rate
18501852 assert samples .pts_seconds == asset .get_frame_info (idx = 0 ).pts_seconds
18511853
1852- @pytest .mark .parametrize ("asset" , (NASA_AUDIO , NASA_AUDIO_MP3 , SINE_16_CHANNELS ))
1854+ @pytest .mark .parametrize ("asset" , (NASA_AUDIO , NASA_AUDIO_MP3 , SINE_16_CHANNEL_S16 ))
18531855 def test_get_all_samples (self , asset ):
18541856 decoder = AudioDecoder (asset .path )
18551857 torch .testing .assert_close (
@@ -2118,8 +2120,7 @@ def test_samples_duration(self, asset, sample_rate):
21182120 # that the extra tensor allocation that happens within
21192121 # maybeFlushSwrBuffers() is correct.
21202122 @pytest .mark .parametrize ("sample_rate" , (None , 16_000 ))
2121- # FFmpeg can handle up to AV_NUM_DATA_POINTERS=8 channels
2122- @pytest .mark .parametrize ("num_channels" , (1 , 2 , 8 , None ))
2123+ @pytest .mark .parametrize ("num_channels" , (1 , 2 , 8 , 16 , None ))
21232124 def test_num_channels (self , asset , sample_rate , num_channels ):
21242125 decoder = AudioDecoder (
21252126 asset .path , sample_rate = sample_rate , num_channels = num_channels
@@ -2133,12 +2134,5 @@ def test_num_channels(self, asset, sample_rate, num_channels):
21332134
21342135 @pytest .mark .parametrize ("asset" , (SINE_MONO_S32 , NASA_AUDIO_MP3 ))
21352136 def test_num_channels_errors (self , asset ):
2136- with pytest .raises (
2137- RuntimeError , match = "num_channels must be > 0 and <= AV_NUM_DATA_POINTERS"
2138- ):
2137+ with pytest .raises (RuntimeError , match = "num_channels must be > 0" ):
21392138 AudioDecoder (asset .path , num_channels = 0 )
2140- with pytest .raises (
2141- RuntimeError , match = "num_channels must be > 0 and <= AV_NUM_DATA_POINTERS"
2142- ):
2143- # FFmpeg can handle up to AV_NUM_DATA_POINTERS=8 channels
2144- AudioDecoder (asset .path , num_channels = 9 )
0 commit comments