Enhancement: Expanded Audio Format Support with Soundfile #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request significantly enhances the audio loading capabilities of our
soundevent
library.Key Improvements:
soundevent
only supported WAV files. We've now integrated thesoundfile
library, enabling support for a wide array of lossless and lossy audio formats (FLAC, MP3, etc.), making the library more versatile and accommodating a broader range of use cases.audio.attributes
module now defines standardized attributes for audio arrays, aligning with the newarrays
module and promoting consistency throughout the codebase.audio.operations
module for audio-specific array operations (filtering, resampling, PCEN), resulting in a cleaner code organization.librosa
.audio.is_audio_file
function now recognizes all supported formats. We've also added a "strict" mode for more thorough file validation usingsoundfile
.audio.get_audio_files
function allows easy recursive iteration over all audio files within a directory.Breaking Changes:
MediaInfo
object has been modified to includeformat
andsubtype
fields (replacingformat
andbit_depth
). This change was necessary to accommodate the wider range of audio formats. While it's a breaking change, it significantly improves the library's flexibility.Additional Notes:
audio.spectrum
module due to the expanded capabilities provided bysoundfile
and the newarrays.operations
module.