MLECO-3036: Update to use Pathlib in Python scripts
* Pathlib used in Python scripts over os
* Bug fix for build_default.py
* Minor code style updates
Signed-off-by: Richard Burton <richard.burton@arm.com>
Change-Id: I5fc2e582a84443c3fb79250eb711b960d63ed8fd
diff --git a/scripts/py/gen_audio.py b/scripts/py/gen_audio.py
index 53ed019..e997499 100644
--- a/scripts/py/gen_audio.py
+++ b/scripts/py/gen_audio.py
@@ -36,6 +36,7 @@
parser.add_argument("-v", "--verbosity", action="store_true")
args = parser.parse_args()
+
def main(args):
audio_data, samplerate = AudioUtils.load_resample_audio_clip(args.audio_path,
args.sampling_rate,
@@ -44,5 +45,6 @@
args.min_samples)
sf.write(path.join(args.output_dir, path.basename(args.audio_path)), audio_data, samplerate)
+
if __name__ == '__main__':
main(args)