Skip to content

Commit

Permalink
Merge pull request #60 from RuABraun/feature/flac
Browse files Browse the repository at this point in the history
adding flac support
  • Loading branch information
kamo-naoyuki authored Sep 10, 2023
2 parents 28a6f0a + 50c9ada commit b1cac2c
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 b1cac2c

Please sign in to comment.