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

namespace Google\Cloud\Dialogflow\Cx\V3;

use UnexpectedValueException;

/**
 * Audio encoding of the output audio format in Text-To-Speech.
 *
 * Protobuf type <code>google.cloud.dialogflow.cx.v3.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;
    /**
     * MP3 audio at 64kbps.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4;</code>
     */
    const OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4;
    /**
     * 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;
    /**
     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_MULAW = 5;</code>
     */
    const OUTPUT_AUDIO_ENCODING_MULAW = 5;
    /**
     * 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law.
     *
     * Generated from protobuf enum <code>OUTPUT_AUDIO_ENCODING_ALAW = 6;</code>
     */
    const OUTPUT_AUDIO_ENCODING_ALAW = 6;

    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_MP3_64_KBPS => 'OUTPUT_AUDIO_ENCODING_MP3_64_KBPS',
        self::OUTPUT_AUDIO_ENCODING_OGG_OPUS => 'OUTPUT_AUDIO_ENCODING_OGG_OPUS',
        self::OUTPUT_AUDIO_ENCODING_MULAW => 'OUTPUT_AUDIO_ENCODING_MULAW',
        self::OUTPUT_AUDIO_ENCODING_ALAW => 'OUTPUT_AUDIO_ENCODING_ALAW',
    ];

    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);
    }
}

