Skip to main content
Glama
allvoicelab

All Voice Lab MCP Server

Official
by allvoicelab

download_dubbing_audio

Retrieve and download processed audio files from completed dubbing projects using the dubbing ID from video dubbing or translation operations.

Instructions

[AllVoiceLab Tool] Download the audio file from a completed dubbing project.

This tool retrieves and downloads the processed audio file from a previously completed dubbing project.
It requires a valid dubbing ID that was returned from a successful video_dubbing or video_translation_dubbing operation.

Args:
    dubbing_id: The unique identifier of the dubbing project to download. Required.
    output_dir: Output directory for the downloaded audio file. Default is user's desktop.
    
Returns:
    TextContent containing file path to the downloaded audio file.
    
Limitations:
    - The dubbing project must exist and be in a completed state
    - The dubbing_id must be valid and properly formatted
    - Output directory must be accessible with write permissions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dubbing_idYes
output_dirNo

Implementation Reference

  • The main handler function that implements the logic for the 'download_dubbing_audio' tool. It validates inputs, uses the AllVoiceLab client to download the dubbing audio file, handles errors, and returns the file path.
    def download_dubbing_file(
        dubbing_id: str,
        output_dir: str = None
    ) -> TextContent:
        """
        Download audio file from a completed dubbing project
        
        Args:
            dubbing_id: The unique identifier of the dubbing project to download. Required.
            output_dir: Output directory for the downloaded audio file. Default is user's desktop.
            
        Returns:
            TextContent: Text content containing the path to the downloaded audio file.
        """
        all_voice_lab = get_client()
        output_dir = all_voice_lab.get_output_path(output_dir)
        logging.info(f"Tool called: download_dubbing_audio")
        logging.info(f"Dubbing ID: {dubbing_id}")
        logging.info(f"Output directory: {output_dir}")
    
        # Validate parameters
        if not dubbing_id:
            logging.warning("Dubbing ID parameter is empty")
            return TextContent(
                type="text",
                text="dubbing_id parameter cannot be empty"
            )
    
        # Validate and create output directory
        is_valid, error_message = validate_output_directory(output_dir)
        if not is_valid:
            return create_error_response(error_message)
    
        try:
            logging.info(f"Starting dubbing audio download, dubbing ID: {dubbing_id}")
            file_path = all_voice_lab.download_dubbing_audio(dubbing_id, output_dir)
            logging.info(f"Dubbing audio download successful, file saved at: {file_path}")
            return TextContent(
                type="text",
                text=f"Dubbing audio download completed, file saved at: {file_path}\n"
            )
        except Exception as e:
            logging.error(f"Dubbing audio download failed: {str(e)}")
            return TextContent(
                type="text",
                text=f"Download failed, tool temporarily unavailable"
            )
  • The registration of the 'download_dubbing_audio' tool using the FastMCP mcp.tool decorator, which associates the name, description (serving as schema), and binds it to the download_dubbing_file handler function.
    mcp.tool(
        name="download_dubbing_audio",
        description="""[AllVoiceLab Tool] Download the audio file from a completed dubbing project.
        
        This tool retrieves and downloads the processed audio file from a previously completed dubbing project.
        It requires a valid dubbing ID that was returned from a successful video_dubbing or video_translation_dubbing operation.
        
        Args:
            dubbing_id: The unique identifier of the dubbing project to download. Required.
            output_dir: Output directory for the downloaded audio file. Default is user's desktop.
            
        Returns:
            TextContent containing file path to the downloaded audio file.
            
        Limitations:
            - The dubbing project must exist and be in a completed state
            - The dubbing_id must be valid and properly formatted
            - Output directory must be accessible with write permissions
        """
    )(download_dubbing_file)

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/allvoicelab/AllVoiceLab-MCP'

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