mfcc
Analyze audio signals by computing Mel-frequency cepstral coefficients (MFCC) to extract spectral features, enabling detailed music analysis from audio time series data.
Instructions
Computes the MFCC of the given audio time series using librosa.
The MFCC is a representation of the audio signal in terms of its
spectral content, which is useful for music analysis.
The MFCC is computed using the following parameters:
- path_audio_time_series_y: The path to the audio time series (CSV file).
It's sometimes better to take harmonics only
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path_audio_time_series_y | Yes |
Implementation Reference
- src/mcp_music_analysis/server.py:146-165 (handler)The main handler function for the 'mfcc' tool. It loads audio time series from CSV, computes MFCC features using librosa.feature.mfcc, saves the result to a temporary CSV file, and returns the file path.@mcp.tool() def mfcc( path_audio_time_series_y: str, ) -> str: """ Computes the MFCC of the given audio time series using librosa. The MFCC is a representation of the audio signal in terms of its spectral content, which is useful for music analysis. The MFCC is computed using the following parameters: - path_audio_time_series_y: The path to the audio time series (CSV file). It's sometimes better to take harmonics only """ y = np.loadtxt(path_audio_time_series_y, delimiter=";") mfcc = librosa.feature.mfcc(y=y) # Save the mfcc to a CSV file name = path_audio_time_series_y.split("/")[-1].split(".")[0] + "_mfcc" mfcc_path = os.path.join(tempfile.gettempdir(), name + ".csv") np.savetxt(mfcc_path, mfcc, delimiter=";") # Return the path to the CSV file return mfcc_path