get_duration
Calculate audio file duration in seconds from time series data to analyze playback length and timing.
Instructions
Returns the total duration (in seconds) of the given audio time series.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path_audio_time_series_y | Yes |
Implementation Reference
- src/mcp_music_analysis/server.py:62-69 (handler)The handler function for the 'get_duration' tool. It loads the audio time series from a CSV file using np.loadtxt and computes the duration using librosa.get_duration.@mcp.tool() def get_duration(path_audio_time_series_y: str) -> float: """ Returns the total duration (in seconds) of the given audio time series. """ y = np.loadtxt(path_audio_time_series_y, delimiter=";") return librosa.get_duration(y=y)
- src/mcp_music_analysis/server.py:62-62 (registration)The @mcp.tool() decorator registers the get_duration function as an MCP tool.@mcp.tool()
- Tool schema definition listed in the MCP prompt, showing input (path_audio_time_series_y: str) and output (float)."- get_duration(path_audio_time_series_y: str) -> float\n"