genproto: google.golang.org/genproto/googleapis/cloud/texttospeech/v1 Index | Files

package texttospeech

import "google.golang.org/genproto/googleapis/cloud/texttospeech/v1"

Index

Package Files

cloud_tts.pb.go

Variables

var (
    SsmlVoiceGender_name = map[int32]string{
        0:  "SSML_VOICE_GENDER_UNSPECIFIED",
        1:  "MALE",
        2:  "FEMALE",
        3:  "NEUTRAL",
    }
    SsmlVoiceGender_value = map[string]int32{
        "SSML_VOICE_GENDER_UNSPECIFIED": 0,
        "MALE":                          1,
        "FEMALE":                        2,
        "NEUTRAL":                       3,
    }
)

Enum value maps for SsmlVoiceGender.

var (
    AudioEncoding_name = map[int32]string{
        0:  "AUDIO_ENCODING_UNSPECIFIED",
        1:  "LINEAR16",
        2:  "MP3",
        3:  "OGG_OPUS",
    }
    AudioEncoding_value = map[string]int32{
        "AUDIO_ENCODING_UNSPECIFIED": 0,
        "LINEAR16":                   1,
        "MP3":                        2,
        "OGG_OPUS":                   3,
    }
)

Enum value maps for AudioEncoding.

var File_google_cloud_texttospeech_v1_cloud_tts_proto protoreflect.FileDescriptor

func RegisterTextToSpeechServer Uses

func RegisterTextToSpeechServer(s *grpc.Server, srv TextToSpeechServer)

type AudioConfig Uses

type AudioConfig struct {

    // Required. The format of the audio byte stream.
    AudioEncoding AudioEncoding `protobuf:"varint,1,opt,name=audio_encoding,json=audioEncoding,proto3,enum=google.cloud.texttospeech.v1.AudioEncoding" json:"audio_encoding,omitempty"`
    // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
    // the normal native speed supported by the specific voice. 2.0 is twice as
    // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
    // speed. Any other values < 0.25 or > 4.0 will return an error.
    SpeakingRate float64 `protobuf:"fixed64,2,opt,name=speaking_rate,json=speakingRate,proto3" json:"speaking_rate,omitempty"`
    // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
    // increase 20 semitones from the original pitch. -20 means decrease 20
    // semitones from the original pitch.
    Pitch float64 `protobuf:"fixed64,3,opt,name=pitch,proto3" json:"pitch,omitempty"`
    // Optional. Input only. Volume gain (in dB) of the normal native volume
    // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
    // set to a value of 0.0 (dB), will play at normal native signal amplitude. A
    // value of -6.0 (dB) will play at approximately half the amplitude of the
    // normal native signal amplitude. A value of +6.0 (dB) will play at
    // approximately twice the amplitude of the normal native signal amplitude.
    // Strongly recommend not to exceed +10 (dB) as there's usually no effective
    // increase in loudness for any value greater than that.
    VolumeGainDb float64 `protobuf:"fixed64,4,opt,name=volume_gain_db,json=volumeGainDb,proto3" json:"volume_gain_db,omitempty"`
    // Optional. The synthesis sample rate (in hertz) for this audio. When this is
    // specified in SynthesizeSpeechRequest, if this is different from the voice's
    // natural sample rate, then the synthesizer will honor this request by
    // converting to the desired sample rate (which might result in worse audio
    // quality), unless the specified sample rate is not supported for the
    // encoding chosen, in which case it will fail the request and return
    // [google.rpc.Code.INVALID_ARGUMENT][].
    SampleRateHertz int32 `protobuf:"varint,5,opt,name=sample_rate_hertz,json=sampleRateHertz,proto3" json:"sample_rate_hertz,omitempty"`
    // Optional. Input only. An identifier which selects 'audio effects' profiles
    // that are applied on (post synthesized) text to speech. Effects are applied
    // on top of each other in the order they are given. See
    // [audio
    // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
    // current supported profile ids.
    EffectsProfileId []string `protobuf:"bytes,6,rep,name=effects_profile_id,json=effectsProfileId,proto3" json:"effects_profile_id,omitempty"`
    // contains filtered or unexported fields
}

Description of audio data to be synthesized.

func (*AudioConfig) Descriptor Uses

func (*AudioConfig) Descriptor() ([]byte, []int)

Deprecated: Use AudioConfig.ProtoReflect.Descriptor instead.

func (*AudioConfig) GetAudioEncoding Uses

func (x *AudioConfig) GetAudioEncoding() AudioEncoding

func (*AudioConfig) GetEffectsProfileId Uses

func (x *AudioConfig) GetEffectsProfileId() []string

func (*AudioConfig) GetPitch Uses

func (x *AudioConfig) GetPitch() float64

func (*AudioConfig) GetSampleRateHertz Uses

func (x *AudioConfig) GetSampleRateHertz() int32

func (*AudioConfig) GetSpeakingRate Uses

func (x *AudioConfig) GetSpeakingRate() float64

func (*AudioConfig) GetVolumeGainDb Uses

func (x *AudioConfig) GetVolumeGainDb() float64

func (*AudioConfig) ProtoMessage Uses

func (*AudioConfig) ProtoMessage()

func (*AudioConfig) ProtoReflect Uses

func (x *AudioConfig) ProtoReflect() protoreflect.Message

func (*AudioConfig) Reset Uses

func (x *AudioConfig) Reset()

func (*AudioConfig) String Uses

func (x *AudioConfig) String() string

type AudioEncoding Uses

type AudioEncoding int32

Configuration to set up audio encoder. The encoding determines the output audio format that we'd like.

const (
    // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
    AudioEncoding_AUDIO_ENCODING_UNSPECIFIED AudioEncoding = 0
    // Uncompressed 16-bit signed little-endian samples (Linear PCM).
    // Audio content returned as LINEAR16 also contains a WAV header.
    AudioEncoding_LINEAR16 AudioEncoding = 1
    // MP3 audio at 32kbps.
    AudioEncoding_MP3 AudioEncoding = 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.
    AudioEncoding_OGG_OPUS AudioEncoding = 3
)

func (AudioEncoding) Descriptor Uses

func (AudioEncoding) Descriptor() protoreflect.EnumDescriptor

func (AudioEncoding) Enum Uses

func (x AudioEncoding) Enum() *AudioEncoding

func (AudioEncoding) EnumDescriptor Uses

func (AudioEncoding) EnumDescriptor() ([]byte, []int)

Deprecated: Use AudioEncoding.Descriptor instead.

func (AudioEncoding) Number Uses

func (x AudioEncoding) Number() protoreflect.EnumNumber

func (AudioEncoding) String Uses

func (x AudioEncoding) String() string

func (AudioEncoding) Type Uses

func (AudioEncoding) Type() protoreflect.EnumType

type ListVoicesRequest Uses

type ListVoicesRequest struct {

    // Optional. Recommended.
    // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If
    // specified, the ListVoices call will only return voices that can be used to
    // synthesize this language_code. E.g. when specifying "en-NZ", you will get
    // supported "en-\*" voices; when specifying "no", you will get supported
    // "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh"
    // will also get supported "cmn-\*" voices; specifying "zh-hk" will also get
    // supported "yue-\*" voices.
    LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
    // contains filtered or unexported fields
}

The top-level message sent by the client for the `ListVoices` method.

func (*ListVoicesRequest) Descriptor Uses

func (*ListVoicesRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListVoicesRequest.ProtoReflect.Descriptor instead.

func (*ListVoicesRequest) GetLanguageCode Uses

func (x *ListVoicesRequest) GetLanguageCode() string

func (*ListVoicesRequest) ProtoMessage Uses

func (*ListVoicesRequest) ProtoMessage()

func (*ListVoicesRequest) ProtoReflect Uses

func (x *ListVoicesRequest) ProtoReflect() protoreflect.Message

func (*ListVoicesRequest) Reset Uses

func (x *ListVoicesRequest) Reset()

func (*ListVoicesRequest) String Uses

func (x *ListVoicesRequest) String() string

type ListVoicesResponse Uses

type ListVoicesResponse struct {

    // The list of voices.
    Voices []*Voice `protobuf:"bytes,1,rep,name=voices,proto3" json:"voices,omitempty"`
    // contains filtered or unexported fields
}

The message returned to the client by the `ListVoices` method.

func (*ListVoicesResponse) Descriptor Uses

func (*ListVoicesResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListVoicesResponse.ProtoReflect.Descriptor instead.

func (*ListVoicesResponse) GetVoices Uses

func (x *ListVoicesResponse) GetVoices() []*Voice

func (*ListVoicesResponse) ProtoMessage Uses

func (*ListVoicesResponse) ProtoMessage()

func (*ListVoicesResponse) ProtoReflect Uses

func (x *ListVoicesResponse) ProtoReflect() protoreflect.Message

func (*ListVoicesResponse) Reset Uses

func (x *ListVoicesResponse) Reset()

func (*ListVoicesResponse) String Uses

func (x *ListVoicesResponse) String() string

type SsmlVoiceGender Uses

type SsmlVoiceGender int32

Gender of the voice as described in [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice).

const (
    // An unspecified gender.
    // In VoiceSelectionParams, this means that the client doesn't care which
    // gender the selected voice will have. In the Voice field of
    // ListVoicesResponse, this may mean that the voice doesn't fit any of the
    // other categories in this enum, or that the gender of the voice isn't known.
    SsmlVoiceGender_SSML_VOICE_GENDER_UNSPECIFIED SsmlVoiceGender = 0
    // A male voice.
    SsmlVoiceGender_MALE SsmlVoiceGender = 1
    // A female voice.
    SsmlVoiceGender_FEMALE SsmlVoiceGender = 2
    // A gender-neutral voice.
    SsmlVoiceGender_NEUTRAL SsmlVoiceGender = 3
)

func (SsmlVoiceGender) Descriptor Uses

func (SsmlVoiceGender) Descriptor() protoreflect.EnumDescriptor

func (SsmlVoiceGender) Enum Uses

func (x SsmlVoiceGender) Enum() *SsmlVoiceGender

func (SsmlVoiceGender) EnumDescriptor Uses

func (SsmlVoiceGender) EnumDescriptor() ([]byte, []int)

Deprecated: Use SsmlVoiceGender.Descriptor instead.

func (SsmlVoiceGender) Number Uses

func (x SsmlVoiceGender) Number() protoreflect.EnumNumber

func (SsmlVoiceGender) String Uses

func (x SsmlVoiceGender) String() string

func (SsmlVoiceGender) Type Uses

func (SsmlVoiceGender) Type() protoreflect.EnumType

type SynthesisInput Uses

type SynthesisInput struct {

    // The input source, which is either plain text or SSML.
    //
    // Types that are assignable to InputSource:
    //	*SynthesisInput_Text
    //	*SynthesisInput_Ssml
    InputSource isSynthesisInput_InputSource `protobuf_oneof:"input_source"`
    // contains filtered or unexported fields
}

Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 characters.

func (*SynthesisInput) Descriptor Uses

func (*SynthesisInput) Descriptor() ([]byte, []int)

Deprecated: Use SynthesisInput.ProtoReflect.Descriptor instead.

func (*SynthesisInput) GetInputSource Uses

func (m *SynthesisInput) GetInputSource() isSynthesisInput_InputSource

func (*SynthesisInput) GetSsml Uses

func (x *SynthesisInput) GetSsml() string

func (*SynthesisInput) GetText Uses

func (x *SynthesisInput) GetText() string

func (*SynthesisInput) ProtoMessage Uses

func (*SynthesisInput) ProtoMessage()

func (*SynthesisInput) ProtoReflect Uses

func (x *SynthesisInput) ProtoReflect() protoreflect.Message

func (*SynthesisInput) Reset Uses

func (x *SynthesisInput) Reset()

func (*SynthesisInput) String Uses

func (x *SynthesisInput) String() string

type SynthesisInput_Ssml Uses

type SynthesisInput_Ssml struct {
    // The SSML document to be synthesized. The SSML document must be valid
    // and well-formed. Otherwise the RPC will fail and return
    // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
    // [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
    Ssml string `protobuf:"bytes,2,opt,name=ssml,proto3,oneof"`
}

type SynthesisInput_Text Uses

type SynthesisInput_Text struct {
    // The raw text to be synthesized.
    Text string `protobuf:"bytes,1,opt,name=text,proto3,oneof"`
}

type SynthesizeSpeechRequest Uses

type SynthesizeSpeechRequest struct {

    // Required. The Synthesizer requires either plain text or SSML as input.
    Input *SynthesisInput `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
    // Required. The desired voice of the synthesized audio.
    Voice *VoiceSelectionParams `protobuf:"bytes,2,opt,name=voice,proto3" json:"voice,omitempty"`
    // Required. The configuration of the synthesized audio.
    AudioConfig *AudioConfig `protobuf:"bytes,3,opt,name=audio_config,json=audioConfig,proto3" json:"audio_config,omitempty"`
    // contains filtered or unexported fields
}

The top-level message sent by the client for the `SynthesizeSpeech` method.

func (*SynthesizeSpeechRequest) Descriptor Uses

func (*SynthesizeSpeechRequest) Descriptor() ([]byte, []int)

Deprecated: Use SynthesizeSpeechRequest.ProtoReflect.Descriptor instead.

func (*SynthesizeSpeechRequest) GetAudioConfig Uses

func (x *SynthesizeSpeechRequest) GetAudioConfig() *AudioConfig

func (*SynthesizeSpeechRequest) GetInput Uses

func (x *SynthesizeSpeechRequest) GetInput() *SynthesisInput

func (*SynthesizeSpeechRequest) GetVoice Uses

func (x *SynthesizeSpeechRequest) GetVoice() *VoiceSelectionParams

func (*SynthesizeSpeechRequest) ProtoMessage Uses

func (*SynthesizeSpeechRequest) ProtoMessage()

func (*SynthesizeSpeechRequest) ProtoReflect Uses

func (x *SynthesizeSpeechRequest) ProtoReflect() protoreflect.Message

func (*SynthesizeSpeechRequest) Reset Uses

func (x *SynthesizeSpeechRequest) Reset()

func (*SynthesizeSpeechRequest) String Uses

func (x *SynthesizeSpeechRequest) String() string

type SynthesizeSpeechResponse Uses

type SynthesizeSpeechResponse struct {

    // The audio data bytes encoded as specified in the request, including the
    // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).
    // For LINEAR16 audio, we include the WAV header. Note: as
    // with all bytes fields, protobuffers use a pure binary representation,
    // whereas JSON representations use base64.
    AudioContent []byte `protobuf:"bytes,1,opt,name=audio_content,json=audioContent,proto3" json:"audio_content,omitempty"`
    // contains filtered or unexported fields
}

The message returned to the client by the `SynthesizeSpeech` method.

func (*SynthesizeSpeechResponse) Descriptor Uses

func (*SynthesizeSpeechResponse) Descriptor() ([]byte, []int)

Deprecated: Use SynthesizeSpeechResponse.ProtoReflect.Descriptor instead.

func (*SynthesizeSpeechResponse) GetAudioContent Uses

func (x *SynthesizeSpeechResponse) GetAudioContent() []byte

func (*SynthesizeSpeechResponse) ProtoMessage Uses

func (*SynthesizeSpeechResponse) ProtoMessage()

func (*SynthesizeSpeechResponse) ProtoReflect Uses

func (x *SynthesizeSpeechResponse) ProtoReflect() protoreflect.Message

func (*SynthesizeSpeechResponse) Reset Uses

func (x *SynthesizeSpeechResponse) Reset()

func (*SynthesizeSpeechResponse) String Uses

func (x *SynthesizeSpeechResponse) String() string

type TextToSpeechClient Uses

type TextToSpeechClient interface {
    // Returns a list of Voice supported for synthesis.
    ListVoices(ctx context.Context, in *ListVoicesRequest, opts ...grpc.CallOption) (*ListVoicesResponse, error)
    // Synthesizes speech synchronously: receive results after all text input
    // has been processed.
    SynthesizeSpeech(ctx context.Context, in *SynthesizeSpeechRequest, opts ...grpc.CallOption) (*SynthesizeSpeechResponse, error)
}

TextToSpeechClient is the client API for TextToSpeech service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTextToSpeechClient Uses

func NewTextToSpeechClient(cc grpc.ClientConnInterface) TextToSpeechClient

type TextToSpeechServer Uses

type TextToSpeechServer interface {
    // Returns a list of Voice supported for synthesis.
    ListVoices(context.Context, *ListVoicesRequest) (*ListVoicesResponse, error)
    // Synthesizes speech synchronously: receive results after all text input
    // has been processed.
    SynthesizeSpeech(context.Context, *SynthesizeSpeechRequest) (*SynthesizeSpeechResponse, error)
}

TextToSpeechServer is the server API for TextToSpeech service.

type UnimplementedTextToSpeechServer Uses

type UnimplementedTextToSpeechServer struct {
}

UnimplementedTextToSpeechServer can be embedded to have forward compatible implementations.

func (*UnimplementedTextToSpeechServer) ListVoices Uses

func (*UnimplementedTextToSpeechServer) ListVoices(context.Context, *ListVoicesRequest) (*ListVoicesResponse, error)

func (*UnimplementedTextToSpeechServer) SynthesizeSpeech Uses

func (*UnimplementedTextToSpeechServer) SynthesizeSpeech(context.Context, *SynthesizeSpeechRequest) (*SynthesizeSpeechResponse, error)

type Voice Uses

type Voice struct {

    // The languages that this voice supports, expressed as
    // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
    // "en-US", "es-419", "cmn-tw").
    LanguageCodes []string `protobuf:"bytes,1,rep,name=language_codes,json=languageCodes,proto3" json:"language_codes,omitempty"`
    // The name of this voice.  Each distinct voice has a unique name.
    Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
    // The gender of this voice.
    SsmlGender SsmlVoiceGender `protobuf:"varint,3,opt,name=ssml_gender,json=ssmlGender,proto3,enum=google.cloud.texttospeech.v1.SsmlVoiceGender" json:"ssml_gender,omitempty"`
    // The natural sample rate (in hertz) for this voice.
    NaturalSampleRateHertz int32 `protobuf:"varint,4,opt,name=natural_sample_rate_hertz,json=naturalSampleRateHertz,proto3" json:"natural_sample_rate_hertz,omitempty"`
    // contains filtered or unexported fields
}

Description of a voice supported by the TTS service.

func (*Voice) Descriptor Uses

func (*Voice) Descriptor() ([]byte, []int)

Deprecated: Use Voice.ProtoReflect.Descriptor instead.

func (*Voice) GetLanguageCodes Uses

func (x *Voice) GetLanguageCodes() []string

func (*Voice) GetName Uses

func (x *Voice) GetName() string

func (*Voice) GetNaturalSampleRateHertz Uses

func (x *Voice) GetNaturalSampleRateHertz() int32

func (*Voice) GetSsmlGender Uses

func (x *Voice) GetSsmlGender() SsmlVoiceGender

func (*Voice) ProtoMessage Uses

func (*Voice) ProtoMessage()

func (*Voice) ProtoReflect Uses

func (x *Voice) ProtoReflect() protoreflect.Message

func (*Voice) Reset Uses

func (x *Voice) Reset()

func (*Voice) String Uses

func (x *Voice) String() string

type VoiceSelectionParams Uses

type VoiceSelectionParams struct {

    // Required. The language (and potentially also the region) of the voice expressed as a
    // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
    // "en-US". This should not include a script tag (e.g. use
    // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
    // from the input provided in the SynthesisInput.  The TTS service
    // will use this parameter to help choose an appropriate voice.  Note that
    // the TTS service may choose a voice with a slightly different language code
    // than the one selected; it may substitute a different region
    // (e.g. using en-US rather than en-CA if there isn't a Canadian voice
    // available), or even a different language, e.g. using "nb" (Norwegian
    // Bokmal) instead of "no" (Norwegian)".
    LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
    // The name of the voice. If not set, the service will choose a
    // voice based on the other parameters such as language_code and gender.
    Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
    // The preferred gender of the voice. If not set, the service will
    // choose a voice based on the other parameters such as language_code and
    // name. Note that this is only a preference, not requirement; if a
    // voice of the appropriate gender is not available, the synthesizer should
    // substitute a voice with a different gender rather than failing the request.
    SsmlGender SsmlVoiceGender `protobuf:"varint,3,opt,name=ssml_gender,json=ssmlGender,proto3,enum=google.cloud.texttospeech.v1.SsmlVoiceGender" json:"ssml_gender,omitempty"`
    // contains filtered or unexported fields
}

Description of which voice to use for a synthesis request.

func (*VoiceSelectionParams) Descriptor Uses

func (*VoiceSelectionParams) Descriptor() ([]byte, []int)

Deprecated: Use VoiceSelectionParams.ProtoReflect.Descriptor instead.

func (*VoiceSelectionParams) GetLanguageCode Uses

func (x *VoiceSelectionParams) GetLanguageCode() string

func (*VoiceSelectionParams) GetName Uses

func (x *VoiceSelectionParams) GetName() string

func (*VoiceSelectionParams) GetSsmlGender Uses

func (x *VoiceSelectionParams) GetSsmlGender() SsmlVoiceGender

func (*VoiceSelectionParams) ProtoMessage Uses

func (*VoiceSelectionParams) ProtoMessage()

func (*VoiceSelectionParams) ProtoReflect Uses

func (x *VoiceSelectionParams) ProtoReflect() protoreflect.Message

func (*VoiceSelectionParams) Reset Uses

func (x *VoiceSelectionParams) Reset()

func (*VoiceSelectionParams) String Uses

func (x *VoiceSelectionParams) String() string

Package texttospeech imports 10 packages (graph) and is imported by 8 packages. Updated 2020-09-07. Refresh now. Tools for package owners.