I'm attempting to read a zip file containing both M4A and WAV files. My goal is to extract and process these audio files, and then upload them as NPY files to a database.
I'm uncertain whether my current approach of reading the files directly from the zip archive is appropriate. Should I consider using the librosa library specifically for handling the WAV files?
with zipfile.ZipFile(zip_path) as z:
audio_files = [file_path for file_path in sorted(z.namelist()) if
file_path.endswith('.m4a') ]
for audio_file_path in tqdm(audio_files):
lines = []
for line in z.read(audio_file_path):
lines.append(line)