raiseTypeError('Expected a CPU based tensor, got %s'%type(src))
raiseTypeError('Expected a CPU based tensor, got %s'%type(src))
defload(filepath,out=None,normalization=None):
defload(filepath,out=None,normalization=None):
"""Loads an audio file from disk into a Tensor
"""Loads an audio file from disk into a Tensor
Args:
Args:
filepath (string): path to audio file
filepath (string): path to audio file
out (Tensor, optional): an output Tensor to use instead of creating one
out (Tensor, optional): an output Tensor to use instead of creating one
normalization (bool or number, optional): If boolean `True`, then output is divided by `1 << 31` (assumes 16-bit depth audio, and normalizes to `[0, 1]`. If `number`, then output is divided by that number
normalization (bool or number, optional): If boolean `True`, then output is divided by `1 << 31`
(assumes 16-bit depth audio, and normalizes to `[0, 1]`.
If `number`, then output is divided by that number
Returns: tuple(Tensor, int)
Returns: tuple(Tensor, int)
- Tensor: output Tensor of size `[L x C]` where L is the number of audio frames, C is the number of channels
- Tensor: output Tensor of size `[L x C]` where L is the number of audio frames, C is the number of channels