Skip to main content
Glama

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
NameRequiredDescriptionDefault
path_audio_time_series_yYes

Implementation Reference

  • 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

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hugohow/mcp-music-analysis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server