<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/audio_config.proto

namespace Google\Cloud\Dialogflow\V2;

use UnexpectedValueException;

/**
 * Audio encoding of the output audio format in Text-To-Speech.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.OutputAudioEncoding</code>
 */
class OutputAudioEncoding
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0;</code>
     */
    const OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0;
    /**
     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
     * Audio content returned as LINEAR16 also contains a WAV header.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1;</code>
     */
    const OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1;
    /**
     * MP3 audio at 32kbps.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_MP3 = 2;</code>
     */
    const OUTPUT_AUDIO_ENCODING_MP3 = 2;
    /**
     * Opus encoded audio wrapped in an ogg container. The result will be a
     * file which can be played natively on Android, and in browsers (at least
     * Chrome and Firefox). The quality of the encoding is considerably higher
     * than MP3 while using approximately the same bitrate.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3;</code>
     */
    const OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3;

    private static $valueToName = [
        self::OUTPUT_AUDIO_ENCODING_UNSPECIFIED => 'OUTPUT_AUDIO_ENCODING_UNSPECIFIED',
        self::OUTPUT_AUDIO_ENCODING_LINEAR_16 => 'OUTPUT_AUDIO_ENCODING_LINEAR_16',
        self::OUTPUT_AUDIO_ENCODING_MP3 => 'OUTPUT_AUDIO_ENCODING_MP3',
        self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

