File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from . import sox_utils
4
4
from .download import download_asset
5
-
5
+ import os
6
6
from torchcodec .decoders import AudioDecoder
7
+ import pytest
7
8
8
9
def load_torchcodec (file , ** args ):
9
- decoder = AudioDecoder (file )
10
- if 'start_seconds' in args or 'stop_seconds' in args :
11
- samples = decoder .get_samples_played_in_range (** args )
12
- else :
13
- samples = decoder .get_all_samples ()
14
- return (samples .data , samples .sample_rate )
10
+ try :
11
+ decoder = AudioDecoder (file )
12
+ if 'start_seconds' in args or 'stop_seconds' in args :
13
+ samples = decoder .get_samples_played_in_range (** args )
14
+ else :
15
+ samples = decoder .get_all_samples ()
16
+ return (samples .data , samples .sample_rate )
17
+ except Exception as e :
18
+ if "buggy FFmpeg version" in str (e ) and "PYTEST_CURRENT_TEST" in os .environ :
19
+ pytest .skip ()
20
+ else :
21
+ raise e
15
22
16
23
__all__ = [
17
24
"load_torchcodec" ,
You can’t perform that action at this time.
0 commit comments