def load_wav_file(file_path):
try:
# Load the audio file using librosa
audio_data, sample_rate = librosa.load(file_path, sr=None)
return audio_data, sample_rate
except Exception as e:
print(f"Error loading the audio file: {e}")
return None, None
working_file = pd.read_csv('/home/udita/Audio_File_Details/working_files.csv')
for filename in os.listdir(audio_folder):
if any(working_file['Filename'] == filename):
audio_path = os.path.join(audio_folder, filename)
audio_data, sample_rate = load_wav_file(audio_path)
if audio_data is not None and sample_rate is not None:
continue
else:
print(f"Failed to load the audio file {audio_path}")
I am trying to load the audio files using librosa and almost all of them have a header error:
Warning: Xing stream size off by more than 1%, fuzzy seeking may be even more fuzzy than by design! Note: Illegal Audio-MPEG-Header 0xc328bc1a at offset 2503680. Note: Trying to resync... Note: Skipped 932 bytes in input. Note: Illegal Audio-MPEG-Header 0xc1f9b81c at offset 4849892. Note: Trying to resync... Note: Skipped 932 bytes in input. Note: Illegal Audio-MPEG-Header 0xc1e128de at offset 7814344. Note: Trying to resync... Note: Skipped 932 bytes in input. Note: Illegal Audio-MPEG-Header 0xc0000034 at offset 7890156. Note: Trying to resync...
I have over 3000 files and I can't seem to get rid of this error.