Add more typing annotations

This commit is contained in:
Guillaume Klein
2023-03-15 15:22:53 +01:00
parent 8bd013ea99
commit eafb2c79a3
2 changed files with 62 additions and 50 deletions

View File

@@ -6,13 +6,16 @@ system dependencies. FFmpeg does not need to be installed on the system.
However, the API is quite low-level so we need to manipulate audio frames directly.
"""
import av
import io
import itertools
from typing import BinaryIO, Union
import av
import numpy as np
def decode_audio(input_file, sampling_rate=16000):
def decode_audio(input_file: Union[str, BinaryIO], sampling_rate: int = 16000):
"""Decodes the audio.
Args: