|
@@ -7,6 +7,14 @@ import scipy.io.wavfile
|
|
from matplotlib import pyplot
|
|
from matplotlib import pyplot
|
|
|
|
|
|
|
|
|
|
|
|
+def numpy_array_from_file(
|
|
|
|
+ path: typing.Union[str, pathlib.Path], dtype
|
|
|
|
+) -> numpy.ndarray:
|
|
|
|
+ if isinstance(path, str):
|
|
|
|
+ path = pathlib.Path(path)
|
|
|
|
+ return numpy.frombuffer(path.read_bytes(), dtype=dtype)
|
|
|
|
+
|
|
|
|
+
|
|
def split_sequence_by_delimiter(
|
|
def split_sequence_by_delimiter(
|
|
sequence: typing.Sequence, delimiter: typing.Any, delimiter_min_length: int = 1
|
|
sequence: typing.Sequence, delimiter: typing.Any, delimiter_min_length: int = 1
|
|
) -> typing.Iterator[typing.Sequence]:
|
|
) -> typing.Iterator[typing.Sequence]:
|