def build_speech_response(title, ssml_output, plain_output):
    """Build a speech JSON representation of the title, output text, and end of session."""

    # In this app, the session always ends after a single response.
    return {
        'outputSpeech': {
            'type': 'SSML',
            'ssml': ssml_output
        },
        'card': {
            'type': 'Simple',
            'title': title,
            'content': plain_output
        },
        'shouldEndSession': True
    }