get_duration
Calculate the total duration in seconds of a given audio time series using audio analysis. Input the path to the audio time series to receive precise duration measurement.
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-68 (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)