|
@@ -1,5 +1,7 @@
|
|
|
|
+import pathlib
|
|
import typing
|
|
import typing
|
|
|
|
|
|
|
|
+import numpy
|
|
import scipy.io.wavfile
|
|
import scipy.io.wavfile
|
|
|
|
|
|
|
|
|
|
@@ -24,7 +26,9 @@ def trim_where(
|
|
return sequence[start:stop]
|
|
return sequence[start:stop]
|
|
|
|
|
|
|
|
|
|
-def wavfile_read_mono(path):
|
|
+def wavfile_read_mono(
|
|
|
|
+ path: typing.Union[pathlib.Path, str]
|
|
|
|
+) -> typing.Tuple[int, numpy.ndarray]:
|
|
|
|
|
|
rate, data = scipy.io.wavfile.read(path)
|
|
rate, data = scipy.io.wavfile.read(path)
|
|
data_first_channel = data[:, 0]
|
|
data_first_channel = data[:, 0]
|