def decode(
    model,
    audio_codes,
):
    """
    Decodes the given frames into an output audio waveform
    """

    if len(audio_codes) != 1:
        raise ValueError(f"Expected one frame, got {len(audio_codes)}")

    try:
        audio_values = model.quantizer.from_codes(audio_codes)
        audio_values = model.decode(audio_values[0])

        return audio_values
    except Exception as e:
        print(f"Error in decode method: {str(e)}")
        raise

    Decodes the given frames into an output audio waveform
    
mlx_audio/tts/models/dia/audio.py