|
@@ -6,6 +6,7 @@ import numpy
|
|
|
import pandas
|
|
|
import scipy.io.wavfile
|
|
|
import sympy
|
|
|
+import yaml
|
|
|
from matplotlib import pyplot
|
|
|
|
|
|
|
|
@@ -74,3 +75,13 @@ def wavfile_read_mono(
|
|
|
for channel_index in range(1, data.shape[1]):
|
|
|
assert (data_first_channel == data[:, channel_index]).all()
|
|
|
return rate, data_first_channel
|
|
|
+
|
|
|
+
|
|
|
+def yaml_dump(path: typing.Union[pathlib.Path, str], data: typing.Any) -> None:
|
|
|
+ with pathlib.Path(path).open("w") as stream:
|
|
|
+ yaml.safe_dump(data, stream)
|
|
|
+
|
|
|
+
|
|
|
+def yaml_load(path: typing.Union[pathlib.Path, str]) -> typing.Any:
|
|
|
+ with pathlib.Path(path).open("r") as stream:
|
|
|
+ return yaml.safe_load(stream)
|