3d48f473b0
- found problems with mps - integrated jinja2 templates for rendering (.tex?) - raw ui & bad structure
17 lines
341 B
Python
17 lines
341 B
Python
from dataclasses import dataclass
|
|
import torchaudio
|
|
import torch
|
|
|
|
class Audio:
|
|
waveform: torch.Tensor
|
|
sr: int
|
|
|
|
def load(self, filepath):
|
|
"""
|
|
Loads audio from file's path
|
|
"""
|
|
self.waveform, self.sr = torchaudio.load(
|
|
filepath,
|
|
backend="ffmpeg",
|
|
)
|
|
return self |