Skip to content

Conversation

MLsound
Copy link

@MLsound MLsound commented Sep 7, 2025

This pull request addresses several issues and brings the codebase in line with the latest librosa API. These changes resolve bugs that were preventing some notebooks from running and include general improvements to code quality and project documentation.

This PR is a culmination of a series of commits, and here is a detailed breakdown of the changes:

Key Fixes

  • API Alignment: Updates were made to several functions to align with the latest librosa API, which now requires keyword arguments for certain inputs. This resolves TypeError issues and ensures notebooks run correctly. It fixes Issue Codes needed to be updated #8.
    • librosa.feature.melspectrogram() now uses y= for the audio signal.
    • librosa.feature.rms() now uses y= for the audio signal. Addressed and fixed by @Thecimal in Issue librosa.feature.rms()  #7.
  • librosa.waveplot() Deprecation: Resolved this deprecation in Issue librosa.waveplot() #6 by updating files 8, 9, and 10 to use the modern librosa.display.waveshow function. This fix was provided by @YinhuaChen-cloud.
  • Spectrogram Calculation: The plot_spectrogram utility function was corrected to handle complex input from librosa.stft() properly, resolving a UserWarning and ensuring accurate spectrogram plots.

Code Refactoring & Cleanup

  • Unused Imports: Several unnecessary librosa.display and cmat imports were removed. This cleans up the code and reduces clutter without affecting functionality.
  • File Naming: Trailing spaces were removed from several filenames to prevent potential path issues on various operating systems.

New Features & Documentation

  • Dependency Management: A requirements.txt file was added to the repository.
  • Contributor Recognition: A new CONTRIBUTORS.md file was added to publicly acknowledge all project contributors, fostering a more open and collaborative community.
  • Updated README: The README.md was updated with a full list of lessons and links, providing a more comprehensive overview of the course.

All changes have been tested to confirm that the notebooks and scripts are running as expected.

MLsound added 15 commits August 31, 2025 22:37
This change consolidates all audio assets into a single directory, removes duplicates, and updates the code to reflect the new structure.

The following changes were made to the file system and codebase:
- Deduplication: Identified and removed 25 repeated .wav files, resulting in a significant reduction of 54.68 MB.
- File Organization: All audio files are now located in a single, dedicated directory: 'audio_resources'.
- Code Refactoring: The file-finding logic was updated to search the new 'audio_resources' folder, ensuring all assets are correctly loaded.
- Directory Cleanup: Removed previously-used, now-empty 'audio/' folders from child directories to maintain a clean file structure.
Removing trailing spaces from filenames is a good practice for maintaining coherence and avoiding potential path inconsistency errors. This is crucial as some operating systems or tools may not handle these spaces correctly, leading to errors and broken file paths.
Updates the README file with a comprehensive list of all lessons in the "Audio Signal Processing for Machine Learning" series, including links to videos, slides, and notebooks.
This commit replaces the deprecated `librosa.waveplot()` with the current `librosa.display.waveshow` across the three analysis notebooks (chapters 8, 9, 10). The old function was causing the notebooks to fail. This update ensures they run correctly with the latest version of the librosa library.
This commit fixes a bug where `librosa.feature.rms()` was not working due to an API change in librosa. The function now requires the y keyword argument to explicitly specify the audio signal, rather than accepting it as a positional argument.

The change updates the function calls across the codebase to librosa.feature.rms(y=...), ensuring that the RMS energy calculation works correctly with the latest version of the library.
This commit addresses a UserWarning by explicitly converting the complex output of `librosa.stft()` to its absolute value before passing it to `librosa.amplitude_to_db()`. This ensures the function correctly calculates the power spectrogram and prevents potential issues with later versions of the `librosa` library.
Addresses issue musikalkemist#1.
Renames the folder "10- Fourier Transform: The Intuition" to "10- Fourier Transform: The Intuition" to resolve file system issues and ensure consistency.

This fix was proposed by GuillermoOvejeroSanchez in PR musikalkemist#2.
This commit updates the call to `librosa.feature.melspectrogram()` to align with the latest API. The function now requires the audio signal to be passed using the keyword argument `y`, rather than as a positional argument. The old code was not working, resulting in a `TypeError`. This fix ensures the mel spectrogram is calculated correctly.
This commit adds a `requirements.txt` file to the repository. This file lists all the necessary Python packages and their versions to ensure that the project's dependencies are clearly defined.
- Corrected and expanded contributor entries for improved accuracy and clarity.
- Clarified the nature of past fixes and contributions from community members.
- Reformatted the list for better readability.
This commit cleans up the requirements.txt file by removing packages that are not direct dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant