Skip to content

Commit

Permalink
adding flac support
Browse files Browse the repository at this point in the history
  • Loading branch information
RuABraun committed Jul 6, 2023
1 parent 28a6f0a commit 50c9ada
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kaldiio/matio.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ def read_kaldi(fd, endian="<", audio_loader="soundfile", load_kwargs=None):
# array: Tuple[int, np.ndarray]
array = read_wav(fd)

elif binary_flag[:4] == b"fLaC":
import soundfile
buf = fd.read()
_fd = BytesIO(buf)
audio, rate = soundfile.read(_fd)
array = (rate, audio,)
elif binary_flag[:3] == b"NPY":
fd.read(3)
length_ = _read_length_header(fd)
Expand Down

0 comments on commit 50c9ada

Please sign in to comment.