|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
from typing import Callable
|
|
|
|
|
from typing import Optional
|
|
|
|
@ -9,6 +8,7 @@ from paddle import Tensor
|
|
|
|
|
|
|
|
|
|
#https://github.com/pytorch/audio/blob/main/torchaudio/backend/sox_io_backend.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def load(
|
|
|
|
|
filepath: Union[str, Path],
|
|
|
|
|
out: Optional[Tensor]=None,
|
|
|
|
@ -16,12 +16,15 @@ def load(
|
|
|
|
|
channels_first: bool=True,
|
|
|
|
|
num_frames: int=0,
|
|
|
|
|
offset: int=0,
|
|
|
|
|
filetype: Optional[str] = None,
|
|
|
|
|
) -> Tuple[Tensor, int]:
|
|
|
|
|
filetype: Optional[str]=None, ) -> Tuple[Tensor, int]:
|
|
|
|
|
raise RuntimeError("No audio I/O backend is available.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save(filepath: str, src: Tensor, sample_rate: int, precision: int = 16, channels_first: bool = True) -> None:
|
|
|
|
|
def save(filepath: str,
|
|
|
|
|
src: Tensor,
|
|
|
|
|
sample_rate: int,
|
|
|
|
|
precision: int=16,
|
|
|
|
|
channels_first: bool=True) -> None:
|
|
|
|
|
raise RuntimeError("No audio I/O backend is available.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|