File: common.py

package info (click to toggle)
pytorch-audio 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,696 kB
  • sloc: python: 61,274; cpp: 10,031; sh: 128; ansic: 70; makefile: 34
file content (16 lines) | stat: -rw-r--r-- 549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import torchaudio


# If FFmpeg is 4.1 or older
# Tests that checks the number of output samples from OPUS fails
# They work on 4.2+
# Probably this commit fixed it.
# https://github.com/FFmpeg/FFmpeg/commit/18aea7bdd96b320a40573bccabea56afeccdd91c
def lt42():
    ver = torchaudio.utils.ffmpeg_utils.get_versions()["libavcodec"]
    # 5.1 libavcodec     59. 18.100
    # 4.4 libavcodec     58.134.100
    # 4.3 libavcodec     58. 91.100
    # 4.2 libavcodec     58. 54.100
    # 4.1 libavcodec     58. 35.100
    return ver[0] < 59 and ver[1] < 54