Commit 2d1138c5 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Fix SoundfileBackend method decorators (#3550)

Summary: Pull Request resolved: https://github.com/pytorch/audio/pull/3550

Reviewed By: hwangjeff

Differential Revision: D48219176

Pulled By: mthrok

fbshipit-source-id: 4b11111dd3853cbef4ffe1859ec428ca05394824
parent bc264256
...@@ -219,11 +219,11 @@ class SoXBackend(Backend): ...@@ -219,11 +219,11 @@ class SoXBackend(Backend):
class SoundfileBackend(Backend): class SoundfileBackend(Backend):
@abstractmethod @staticmethod
def info(uri: Union[BinaryIO, str, os.PathLike], format: Optional[str], buffer_size: int = 4096) -> AudioMetaData: def info(uri: Union[BinaryIO, str, os.PathLike], format: Optional[str], buffer_size: int = 4096) -> AudioMetaData:
return soundfile_backend.info(uri, format) return soundfile_backend.info(uri, format)
@abstractmethod @staticmethod
def load( def load(
uri: Union[BinaryIO, str, os.PathLike], uri: Union[BinaryIO, str, os.PathLike],
frame_offset: int = 0, frame_offset: int = 0,
...@@ -235,7 +235,7 @@ class SoundfileBackend(Backend): ...@@ -235,7 +235,7 @@ class SoundfileBackend(Backend):
) -> Tuple[torch.Tensor, int]: ) -> Tuple[torch.Tensor, int]:
return soundfile_backend.load(uri, frame_offset, num_frames, normalize, channels_first, format) return soundfile_backend.load(uri, frame_offset, num_frames, normalize, channels_first, format)
@abstractmethod @staticmethod
def save( def save(
uri: Union[BinaryIO, str, os.PathLike], uri: Union[BinaryIO, str, os.PathLike],
src: torch.Tensor, src: torch.Tensor,
...@@ -250,11 +250,11 @@ class SoundfileBackend(Backend): ...@@ -250,11 +250,11 @@ class SoundfileBackend(Backend):
uri, src, sample_rate, channels_first, format=format, encoding=encoding, bits_per_sample=bits_per_sample uri, src, sample_rate, channels_first, format=format, encoding=encoding, bits_per_sample=bits_per_sample
) )
@abstractmethod @staticmethod
def can_decode(uri, format) -> bool: def can_decode(uri, format) -> bool:
return True return True
@abstractmethod @staticmethod
def can_encode(uri, format) -> bool: def can_encode(uri, format) -> bool:
return True return True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment