Initial commit

This commit is contained in:
2025-05-21 21:03:52 +02:00
commit c47d3205a0
8 changed files with 328 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Helper functions for mknotes
import os
def find_audio_files(directory, extensions=(".mp3", ".m4a")):
"""
Recursively find all audio files in the given directory with the specified extensions.
Returns a list of file paths.
"""
audio_files = []
for root, _, files in os.walk(directory):
for file in files:
if file.lower().endswith(extensions):
audio_files.append(os.path.join(root, file))
return audio_files
def ensure_directory_exists(directory):
"""
Create the directory if it does not exist.
"""
os.makedirs(directory, exist_ok=True)