mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
adding limit support
This commit is contained in:
parent
2c961cc43f
commit
3a9e3a4da7
1 changed files with 4 additions and 1 deletions
|
@ -44,6 +44,9 @@ def read(filename, limit=None):
|
||||||
except audioop.error:
|
except audioop.error:
|
||||||
fs, _, audiofile = wavio.readwav(filename)
|
fs, _, audiofile = wavio.readwav(filename)
|
||||||
|
|
||||||
|
if limit:
|
||||||
|
audiofile = audiofile[:limit * 1000]
|
||||||
|
|
||||||
audiofile = audiofile.T
|
audiofile = audiofile.T
|
||||||
audiofile = audiofile.astype(np.int16)
|
audiofile = audiofile.astype(np.int16)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue