The current implementation of audio loading in LatentSync's whisper module relies on ffmpeg-python, which causes compatibility issues with the following error:
AttributeError: module 'ffmpeg' has no attribute 'Error'
This PR replaces the ffmpeg-python dependency with direct subprocess calls to ffmpeg, which is more reliable and has fewer dependencies. The change affects only the audio loading functionality while maintaining the same behavior and output quality.
Changes:
- Removed ffmpeg-python dependency
- Implemented audio loading using subprocess to call ffmpeg directly
- Added error handling with informative messages
- Maintained original sampling rate and audio format compatibility
Testing:
- Tested with MP3 and WAV audio files
- Verified audio processing quality remains unchanged
- Confirmed compatibility with the rest of the whisper pipeline
Note: This change requires ffmpeg to be installed on the system, which is already a requirement for the original implementation.