Skip to main content
Glama
pixxelboy
by pixxelboy

analyze_loudness

Measure audio loudness using EBU R128 standards. Analyze integrated loudness, true peak, and loudness range from audio files via URL to ensure broadcast compliance.

Instructions

Analyze the loudness of an audio file following EBU R128 standard. Accepts a public URL to an audio file (MP3, WAV, FLAC, OGG, M4A). Returns integrated loudness (LUFS), true peak (dB), and loudness range (LU).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesPublic URL to the audio file to analyze

Implementation Reference

  • The asynchronous handler function that processes the analyze_loudness tool call: validates the audio URL, calls the IRCAM Loudness Analyzer API via HTTP POST, and returns the transformed loudness analysis result (integrated LUFS, true peak dB, loudness range).
    export async function handleAnalyzeLoudness( args: Record<string, unknown> ): Promise<LoudnessAnalysisResult> { const audioUrl = args.audio_url as string; // Validate input const validation = validateAudioUrl(audioUrl); if (!validation.valid) { throw validation.error; } // Call IRCAM Loudness Analyzer API const url = buildApiUrl(IRCAM_API_CONFIG.ENDPOINTS.LOUDNESS_ANALYZER); const response = await httpPost<IrcamLoudnessResponse>(url, { url: audioUrl, }); if (!response.ok || !response.data) { throw response.error || formatError('UNKNOWN_ERROR', 'Failed to analyze loudness'); } // Transform and return result return transformLoudnessResponse(response.data); }
  • The MCP Tool object definition, including name, description, and inputSchema for validating the required 'audio_url' parameter.
    export const analyzeLoudnessTool: Tool = { name: 'analyze_loudness', description: 'Analyze the loudness of an audio file following EBU R128 standard. ' + 'Accepts a public URL to an audio file (MP3, WAV, FLAC, OGG, M4A). ' + 'Returns integrated loudness (LUFS), true peak (dB), and loudness range (LU).', inputSchema: { type: 'object', properties: { audio_url: { type: 'string', description: 'Public URL to the audio file to analyze', }, }, required: ['audio_url'], }, };
  • src/index.ts:37-43 (registration)
    Registration of the analyzeLoudnessTool in the TOOLS array used by the MCP server for listTools requests.
    const TOOLS = [ analyzeMusicTool, separateStemsTool, detectAiMusicTool, analyzeLoudnessTool, checkJobStatusTool, ];
  • src/index.ts:48-54 (registration)
    Mapping of tool name 'analyze_loudness' to its handler function in TOOL_HANDLERS, used during tool call execution.
    const TOOL_HANDLERS: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = { analyze_music: handleAnalyzeMusic, separate_stems: handleSeparateStems, detect_ai_music: handleDetectAiMusic, analyze_loudness: handleAnalyzeLoudness, check_job_status: handleCheckJobStatus, };
  • TypeScript type definition for the output of the analyze_loudness tool (LoudnessAnalysisResult).
    export interface LoudnessAnalysisResult { /** Integrated loudness en LUFS */ integrated_lufs: number; /** True peak en dB */ true_peak_db: number; /** Loudness range (LRA) en LU */ loudness_range: number; }

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/pixxelboy/amplify-mcp'

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