texttospeechv1

package
v0.0.0-...-0deef17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package texttospeechv1 : Operations and models for the TextToSpeechV1 service

Index

Constants

View Source
const (
	AddWordOptions_PartOfSpeech_Dosi = "Dosi"
	AddWordOptions_PartOfSpeech_Fuku = "Fuku"
	AddWordOptions_PartOfSpeech_Gobi = "Gobi"
	AddWordOptions_PartOfSpeech_Hoka = "Hoka"
	AddWordOptions_PartOfSpeech_Jodo = "Jodo"
	AddWordOptions_PartOfSpeech_Josi = "Josi"
	AddWordOptions_PartOfSpeech_Kato = "Kato"
	AddWordOptions_PartOfSpeech_Kedo = "Kedo"
	AddWordOptions_PartOfSpeech_Keyo = "Keyo"
	AddWordOptions_PartOfSpeech_Kigo = "Kigo"
	AddWordOptions_PartOfSpeech_Koyu = "Koyu"
	AddWordOptions_PartOfSpeech_Mesi = "Mesi"
	AddWordOptions_PartOfSpeech_Reta = "Reta"
	AddWordOptions_PartOfSpeech_Stbi = "Stbi"
	AddWordOptions_PartOfSpeech_Stto = "Stto"
	AddWordOptions_PartOfSpeech_Stzo = "Stzo"
	AddWordOptions_PartOfSpeech_Suji = "Suji"
)

Constants associated with the AddWordOptions.PartOfSpeech property. **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-rules#jaNotes).

View Source
const (
	CreateVoiceModelOptions_Language_DeDe = "de-DE"
	CreateVoiceModelOptions_Language_EnGb = "en-GB"
	CreateVoiceModelOptions_Language_EnUs = "en-US"
	CreateVoiceModelOptions_Language_EsEs = "es-ES"
	CreateVoiceModelOptions_Language_EsLa = "es-LA"
	CreateVoiceModelOptions_Language_EsUs = "es-US"
	CreateVoiceModelOptions_Language_FrFr = "fr-FR"
	CreateVoiceModelOptions_Language_ItIt = "it-IT"
	CreateVoiceModelOptions_Language_JaJp = "ja-JP"
	CreateVoiceModelOptions_Language_PtBr = "pt-BR"
)

Constants associated with the CreateVoiceModelOptions.Language property. The language of the new custom voice model. Omit the parameter to use the the default language, `en-US`.

View Source
const (
	GetPronunciationOptions_Voice_DeDeBirgitv3voice    = "de-DE_BirgitV3Voice"
	GetPronunciationOptions_Voice_DeDeBirgitvoice      = "de-DE_BirgitVoice"
	GetPronunciationOptions_Voice_DeDeDieterv3voice    = "de-DE_DieterV3Voice"
	GetPronunciationOptions_Voice_DeDeDietervoice      = "de-DE_DieterVoice"
	GetPronunciationOptions_Voice_EnGbKatev3voice      = "en-GB_KateV3Voice"
	GetPronunciationOptions_Voice_EnGbKatevoice        = "en-GB_KateVoice"
	GetPronunciationOptions_Voice_EnUsAllisonv3voice   = "en-US_AllisonV3Voice"
	GetPronunciationOptions_Voice_EnUsAllisonvoice     = "en-US_AllisonVoice"
	GetPronunciationOptions_Voice_EnUsLisav3voice      = "en-US_LisaV3Voice"
	GetPronunciationOptions_Voice_EnUsLisavoice        = "en-US_LisaVoice"
	GetPronunciationOptions_Voice_EnUsMichaelv3voice   = "en-US_MichaelV3Voice"
	GetPronunciationOptions_Voice_EnUsMichaelvoice     = "en-US_MichaelVoice"
	GetPronunciationOptions_Voice_EsEsEnriquev3voice   = "es-ES_EnriqueV3Voice"
	GetPronunciationOptions_Voice_EsEsEnriquevoice     = "es-ES_EnriqueVoice"
	GetPronunciationOptions_Voice_EsEsLaurav3voice     = "es-ES_LauraV3Voice"
	GetPronunciationOptions_Voice_EsEsLauravoice       = "es-ES_LauraVoice"
	GetPronunciationOptions_Voice_EsLaSofiav3voice     = "es-LA_SofiaV3Voice"
	GetPronunciationOptions_Voice_EsLaSofiavoice       = "es-LA_SofiaVoice"
	GetPronunciationOptions_Voice_EsUsSofiav3voice     = "es-US_SofiaV3Voice"
	GetPronunciationOptions_Voice_EsUsSofiavoice       = "es-US_SofiaVoice"
	GetPronunciationOptions_Voice_FrFrReneev3voice     = "fr-FR_ReneeV3Voice"
	GetPronunciationOptions_Voice_FrFrReneevoice       = "fr-FR_ReneeVoice"
	GetPronunciationOptions_Voice_ItItFrancescav3voice = "it-IT_FrancescaV3Voice"
	GetPronunciationOptions_Voice_ItItFrancescavoice   = "it-IT_FrancescaVoice"
	GetPronunciationOptions_Voice_JaJpEmiv3voice       = "ja-JP_EmiV3Voice"
	GetPronunciationOptions_Voice_JaJpEmivoice         = "ja-JP_EmiVoice"
	GetPronunciationOptions_Voice_PtBrIsabelav3voice   = "pt-BR_IsabelaV3Voice"
	GetPronunciationOptions_Voice_PtBrIsabelavoice     = "pt-BR_IsabelaVoice"
)

Constants associated with the GetPronunciationOptions.Voice property. A voice that specifies the language in which the pronunciation is to be returned. All voices for the same language (for example, `en-US`) return the same translation.

View Source
const (
	GetPronunciationOptions_Format_Ibm = "ibm"
	GetPronunciationOptions_Format_Ipa = "ipa"
)

Constants associated with the GetPronunciationOptions.Format property. The phoneme format in which to return the pronunciation. Omit the parameter to obtain the pronunciation in the default format.

View Source
const (
	GetVoiceOptions_Voice_DeDeBirgitv3voice    = "de-DE_BirgitV3Voice"
	GetVoiceOptions_Voice_DeDeBirgitvoice      = "de-DE_BirgitVoice"
	GetVoiceOptions_Voice_DeDeDieterv3voice    = "de-DE_DieterV3Voice"
	GetVoiceOptions_Voice_DeDeDietervoice      = "de-DE_DieterVoice"
	GetVoiceOptions_Voice_EnGbKatev3voice      = "en-GB_KateV3Voice"
	GetVoiceOptions_Voice_EnGbKatevoice        = "en-GB_KateVoice"
	GetVoiceOptions_Voice_EnUsAllisonv3voice   = "en-US_AllisonV3Voice"
	GetVoiceOptions_Voice_EnUsAllisonvoice     = "en-US_AllisonVoice"
	GetVoiceOptions_Voice_EnUsLisav3voice      = "en-US_LisaV3Voice"
	GetVoiceOptions_Voice_EnUsLisavoice        = "en-US_LisaVoice"
	GetVoiceOptions_Voice_EnUsMichaelv3voice   = "en-US_MichaelV3Voice"
	GetVoiceOptions_Voice_EnUsMichaelvoice     = "en-US_MichaelVoice"
	GetVoiceOptions_Voice_EsEsEnriquev3voice   = "es-ES_EnriqueV3Voice"
	GetVoiceOptions_Voice_EsEsEnriquevoice     = "es-ES_EnriqueVoice"
	GetVoiceOptions_Voice_EsEsLaurav3voice     = "es-ES_LauraV3Voice"
	GetVoiceOptions_Voice_EsEsLauravoice       = "es-ES_LauraVoice"
	GetVoiceOptions_Voice_EsLaSofiav3voice     = "es-LA_SofiaV3Voice"
	GetVoiceOptions_Voice_EsLaSofiavoice       = "es-LA_SofiaVoice"
	GetVoiceOptions_Voice_EsUsSofiav3voice     = "es-US_SofiaV3Voice"
	GetVoiceOptions_Voice_EsUsSofiavoice       = "es-US_SofiaVoice"
	GetVoiceOptions_Voice_FrFrReneev3voice     = "fr-FR_ReneeV3Voice"
	GetVoiceOptions_Voice_FrFrReneevoice       = "fr-FR_ReneeVoice"
	GetVoiceOptions_Voice_ItItFrancescav3voice = "it-IT_FrancescaV3Voice"
	GetVoiceOptions_Voice_ItItFrancescavoice   = "it-IT_FrancescaVoice"
	GetVoiceOptions_Voice_JaJpEmiv3voice       = "ja-JP_EmiV3Voice"
	GetVoiceOptions_Voice_JaJpEmivoice         = "ja-JP_EmiVoice"
	GetVoiceOptions_Voice_PtBrIsabelav3voice   = "pt-BR_IsabelaV3Voice"
	GetVoiceOptions_Voice_PtBrIsabelavoice     = "pt-BR_IsabelaVoice"
)

Constants associated with the GetVoiceOptions.Voice property. The voice for which information is to be returned.

View Source
const (
	ListVoiceModelsOptions_Language_DeDe = "de-DE"
	ListVoiceModelsOptions_Language_EnGb = "en-GB"
	ListVoiceModelsOptions_Language_EnUs = "en-US"
	ListVoiceModelsOptions_Language_EsEs = "es-ES"
	ListVoiceModelsOptions_Language_EsLa = "es-LA"
	ListVoiceModelsOptions_Language_EsUs = "es-US"
	ListVoiceModelsOptions_Language_FrFr = "fr-FR"
	ListVoiceModelsOptions_Language_ItIt = "it-IT"
	ListVoiceModelsOptions_Language_JaJp = "ja-JP"
	ListVoiceModelsOptions_Language_PtBr = "pt-BR"
)

Constants associated with the ListVoiceModelsOptions.Language property. The language for which custom voice models that are owned by the requesting credentials are to be returned. Omit the parameter to see all custom voice models that are owned by the requester.

View Source
const (
	SynthesizeOptions_Voice_DeDeBirgitv3voice    = "de-DE_BirgitV3Voice"
	SynthesizeOptions_Voice_DeDeBirgitvoice      = "de-DE_BirgitVoice"
	SynthesizeOptions_Voice_DeDeDieterv3voice    = "de-DE_DieterV3Voice"
	SynthesizeOptions_Voice_DeDeDietervoice      = "de-DE_DieterVoice"
	SynthesizeOptions_Voice_EnGbKatev3voice      = "en-GB_KateV3Voice"
	SynthesizeOptions_Voice_EnGbKatevoice        = "en-GB_KateVoice"
	SynthesizeOptions_Voice_EnUsAllisonv3voice   = "en-US_AllisonV3Voice"
	SynthesizeOptions_Voice_EnUsAllisonvoice     = "en-US_AllisonVoice"
	SynthesizeOptions_Voice_EnUsLisav3voice      = "en-US_LisaV3Voice"
	SynthesizeOptions_Voice_EnUsLisavoice        = "en-US_LisaVoice"
	SynthesizeOptions_Voice_EnUsMichaelv3voice   = "en-US_MichaelV3Voice"
	SynthesizeOptions_Voice_EnUsMichaelvoice     = "en-US_MichaelVoice"
	SynthesizeOptions_Voice_EsEsEnriquev3voice   = "es-ES_EnriqueV3Voice"
	SynthesizeOptions_Voice_EsEsEnriquevoice     = "es-ES_EnriqueVoice"
	SynthesizeOptions_Voice_EsEsLaurav3voice     = "es-ES_LauraV3Voice"
	SynthesizeOptions_Voice_EsEsLauravoice       = "es-ES_LauraVoice"
	SynthesizeOptions_Voice_EsLaSofiav3voice     = "es-LA_SofiaV3Voice"
	SynthesizeOptions_Voice_EsLaSofiavoice       = "es-LA_SofiaVoice"
	SynthesizeOptions_Voice_EsUsSofiav3voice     = "es-US_SofiaV3Voice"
	SynthesizeOptions_Voice_EsUsSofiavoice       = "es-US_SofiaVoice"
	SynthesizeOptions_Voice_FrFrReneev3voice     = "fr-FR_ReneeV3Voice"
	SynthesizeOptions_Voice_FrFrReneevoice       = "fr-FR_ReneeVoice"
	SynthesizeOptions_Voice_ItItFrancescav3voice = "it-IT_FrancescaV3Voice"
	SynthesizeOptions_Voice_ItItFrancescavoice   = "it-IT_FrancescaVoice"
	SynthesizeOptions_Voice_JaJpEmiv3voice       = "ja-JP_EmiV3Voice"
	SynthesizeOptions_Voice_JaJpEmivoice         = "ja-JP_EmiVoice"
	SynthesizeOptions_Voice_PtBrIsabelav3voice   = "pt-BR_IsabelaV3Voice"
	SynthesizeOptions_Voice_PtBrIsabelavoice     = "pt-BR_IsabelaVoice"
)

Constants associated with the SynthesizeOptions.Voice property. The voice to use for synthesis.

View Source
const (
	Translation_PartOfSpeech_Dosi = "Dosi"
	Translation_PartOfSpeech_Fuku = "Fuku"
	Translation_PartOfSpeech_Gobi = "Gobi"
	Translation_PartOfSpeech_Hoka = "Hoka"
	Translation_PartOfSpeech_Jodo = "Jodo"
	Translation_PartOfSpeech_Josi = "Josi"
	Translation_PartOfSpeech_Kato = "Kato"
	Translation_PartOfSpeech_Kedo = "Kedo"
	Translation_PartOfSpeech_Keyo = "Keyo"
	Translation_PartOfSpeech_Kigo = "Kigo"
	Translation_PartOfSpeech_Koyu = "Koyu"
	Translation_PartOfSpeech_Mesi = "Mesi"
	Translation_PartOfSpeech_Reta = "Reta"
	Translation_PartOfSpeech_Stbi = "Stbi"
	Translation_PartOfSpeech_Stto = "Stto"
	Translation_PartOfSpeech_Stzo = "Stzo"
	Translation_PartOfSpeech_Suji = "Suji"
)

Constants associated with the Translation.PartOfSpeech property. **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-rules#jaNotes).

View Source
const (
	Word_PartOfSpeech_Dosi = "Dosi"
	Word_PartOfSpeech_Fuku = "Fuku"
	Word_PartOfSpeech_Gobi = "Gobi"
	Word_PartOfSpeech_Hoka = "Hoka"
	Word_PartOfSpeech_Jodo = "Jodo"
	Word_PartOfSpeech_Josi = "Josi"
	Word_PartOfSpeech_Kato = "Kato"
	Word_PartOfSpeech_Kedo = "Kedo"
	Word_PartOfSpeech_Keyo = "Keyo"
	Word_PartOfSpeech_Kigo = "Kigo"
	Word_PartOfSpeech_Koyu = "Koyu"
	Word_PartOfSpeech_Mesi = "Mesi"
	Word_PartOfSpeech_Reta = "Reta"
	Word_PartOfSpeech_Stbi = "Stbi"
	Word_PartOfSpeech_Stto = "Stto"
	Word_PartOfSpeech_Stzo = "Stzo"
	Word_PartOfSpeech_Suji = "Suji"
)

Constants associated with the Word.PartOfSpeech property. **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-rules#jaNotes).

View Source
const (
	SUCCESS = 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddWordOptions

type AddWordOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// The word that is to be added or updated for the custom voice model.
	Word *string `json:"word" validate:"required"`

	// The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for
	// representing the phonetic string of a word either as an IPA translation or as an IBM SPR translation. A sounds-like
	// is one or more words that, when combined, sound like the word.
	Translation *string `json:"translation" validate:"required"`

	// **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for
	// the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot
	// create multiple entries with different parts of speech for the same word. For more information, see [Working with
	// Japanese entries](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-rules#jaNotes).
	PartOfSpeech *string `json:"part_of_speech,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

AddWordOptions : The AddWord options.

func (*AddWordOptions) SetCustomizationID

func (options *AddWordOptions) SetCustomizationID(customizationID string) *AddWordOptions

SetCustomizationID : Allow user to set CustomizationID

func (*AddWordOptions) SetHeaders

func (options *AddWordOptions) SetHeaders(param map[string]string) *AddWordOptions

SetHeaders : Allow user to set Headers

func (*AddWordOptions) SetPartOfSpeech

func (options *AddWordOptions) SetPartOfSpeech(partOfSpeech string) *AddWordOptions

SetPartOfSpeech : Allow user to set PartOfSpeech

func (*AddWordOptions) SetTranslation

func (options *AddWordOptions) SetTranslation(translation string) *AddWordOptions

SetTranslation : Allow user to set Translation

func (*AddWordOptions) SetWord

func (options *AddWordOptions) SetWord(word string) *AddWordOptions

SetWord : Allow user to set Word

type AddWordsOptions

type AddWordsOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// The **Add custom words** method accepts an array of `Word` objects. Each object provides a word that is to be added
	// or updated for the custom voice model and the word's translation.
	//
	// The **List custom words** method returns an array of `Word` objects. Each object shows a word and its translation
	// from the custom voice model. The words are listed in alphabetical order, with uppercase letters listed before
	// lowercase letters. The array is empty if the custom model contains no words.
	Words []Word `json:"words" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

AddWordsOptions : The AddWords options.

func (*AddWordsOptions) SetCustomizationID

func (options *AddWordsOptions) SetCustomizationID(customizationID string) *AddWordsOptions

SetCustomizationID : Allow user to set CustomizationID

func (*AddWordsOptions) SetHeaders

func (options *AddWordsOptions) SetHeaders(param map[string]string) *AddWordsOptions

SetHeaders : Allow user to set Headers

func (*AddWordsOptions) SetWords

func (options *AddWordsOptions) SetWords(words []Word) *AddWordsOptions

SetWords : Allow user to set Words

type AudioContentTypeWrapper

type AudioContentTypeWrapper struct {
	BinaryStreams []struct {
		ContentType string `json:"content_type"`
	} `json:"binary_streams"`
}

AudioContentTypeWrapper : The service sends this message to confirm the audio format

type CreateVoiceModelOptions

type CreateVoiceModelOptions struct {

	// The name of the new custom voice model.
	Name *string `json:"name" validate:"required"`

	// The language of the new custom voice model. Omit the parameter to use the the default language, `en-US`.
	Language *string `json:"language,omitempty"`

	// A description of the new custom voice model. Specifying a description is recommended.
	Description *string `json:"description,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

CreateVoiceModelOptions : The CreateVoiceModel options.

func (*CreateVoiceModelOptions) SetDescription

func (options *CreateVoiceModelOptions) SetDescription(description string) *CreateVoiceModelOptions

SetDescription : Allow user to set Description

func (*CreateVoiceModelOptions) SetHeaders

func (options *CreateVoiceModelOptions) SetHeaders(param map[string]string) *CreateVoiceModelOptions

SetHeaders : Allow user to set Headers

func (*CreateVoiceModelOptions) SetLanguage

func (options *CreateVoiceModelOptions) SetLanguage(language string) *CreateVoiceModelOptions

SetLanguage : Allow user to set Language

func (*CreateVoiceModelOptions) SetName

func (options *CreateVoiceModelOptions) SetName(name string) *CreateVoiceModelOptions

SetName : Allow user to set Name

type DeleteUserDataOptions

type DeleteUserDataOptions struct {

	// The customer ID for which all data is to be deleted.
	CustomerID *string `json:"customer_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

DeleteUserDataOptions : The DeleteUserData options.

func (*DeleteUserDataOptions) SetCustomerID

func (options *DeleteUserDataOptions) SetCustomerID(customerID string) *DeleteUserDataOptions

SetCustomerID : Allow user to set CustomerID

func (*DeleteUserDataOptions) SetHeaders

func (options *DeleteUserDataOptions) SetHeaders(param map[string]string) *DeleteUserDataOptions

SetHeaders : Allow user to set Headers

type DeleteVoiceModelOptions

type DeleteVoiceModelOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

DeleteVoiceModelOptions : The DeleteVoiceModel options.

func (*DeleteVoiceModelOptions) SetCustomizationID

func (options *DeleteVoiceModelOptions) SetCustomizationID(customizationID string) *DeleteVoiceModelOptions

SetCustomizationID : Allow user to set CustomizationID

func (*DeleteVoiceModelOptions) SetHeaders

func (options *DeleteVoiceModelOptions) SetHeaders(param map[string]string) *DeleteVoiceModelOptions

SetHeaders : Allow user to set Headers

type DeleteWordOptions

type DeleteWordOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// The word that is to be deleted from the custom voice model.
	Word *string `json:"word" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

DeleteWordOptions : The DeleteWord options.

func (*DeleteWordOptions) SetCustomizationID

func (options *DeleteWordOptions) SetCustomizationID(customizationID string) *DeleteWordOptions

SetCustomizationID : Allow user to set CustomizationID

func (*DeleteWordOptions) SetHeaders

func (options *DeleteWordOptions) SetHeaders(param map[string]string) *DeleteWordOptions

SetHeaders : Allow user to set Headers

func (*DeleteWordOptions) SetWord

func (options *DeleteWordOptions) SetWord(word string) *DeleteWordOptions

SetWord : Allow user to set Word

type GetPronunciationOptions

type GetPronunciationOptions struct {

	// The word for which the pronunciation is requested.
	Text *string `json:"text" validate:"required"`

	// A voice that specifies the language in which the pronunciation is to be returned. All voices for the same language
	// (for example, `en-US`) return the same translation.
	Voice *string `json:"voice,omitempty"`

	// The phoneme format in which to return the pronunciation. Omit the parameter to obtain the pronunciation in the
	// default format.
	Format *string `json:"format,omitempty"`

	// The customization ID (GUID) of a custom voice model for which the pronunciation is to be returned. The language of a
	// specified custom model must match the language of the specified voice. If the word is not defined in the specified
	// custom model, the service returns the default translation for the custom model's language. You must make the request
	// with credentials for the instance of the service that owns the custom model. Omit the parameter to see the
	// translation for the specified voice with no customization.
	CustomizationID *string `json:"customization_id,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetPronunciationOptions : The GetPronunciation options.

func (*GetPronunciationOptions) SetCustomizationID

func (options *GetPronunciationOptions) SetCustomizationID(customizationID string) *GetPronunciationOptions

SetCustomizationID : Allow user to set CustomizationID

func (*GetPronunciationOptions) SetFormat

func (options *GetPronunciationOptions) SetFormat(format string) *GetPronunciationOptions

SetFormat : Allow user to set Format

func (*GetPronunciationOptions) SetHeaders

func (options *GetPronunciationOptions) SetHeaders(param map[string]string) *GetPronunciationOptions

SetHeaders : Allow user to set Headers

func (*GetPronunciationOptions) SetText

func (options *GetPronunciationOptions) SetText(text string) *GetPronunciationOptions

SetText : Allow user to set Text

func (*GetPronunciationOptions) SetVoice

func (options *GetPronunciationOptions) SetVoice(voice string) *GetPronunciationOptions

SetVoice : Allow user to set Voice

type GetVoiceModelOptions

type GetVoiceModelOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetVoiceModelOptions : The GetVoiceModel options.

func (*GetVoiceModelOptions) SetCustomizationID

func (options *GetVoiceModelOptions) SetCustomizationID(customizationID string) *GetVoiceModelOptions

SetCustomizationID : Allow user to set CustomizationID

func (*GetVoiceModelOptions) SetHeaders

func (options *GetVoiceModelOptions) SetHeaders(param map[string]string) *GetVoiceModelOptions

SetHeaders : Allow user to set Headers

type GetVoiceOptions

type GetVoiceOptions struct {

	// The voice for which information is to be returned.
	Voice *string `json:"voice" validate:"required"`

	// The customization ID (GUID) of a custom voice model for which information is to be returned. You must make the
	// request with credentials for the instance of the service that owns the custom model. Omit the parameter to see
	// information about the specified voice with no customization.
	CustomizationID *string `json:"customization_id,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetVoiceOptions : The GetVoice options.

func (*GetVoiceOptions) SetCustomizationID

func (options *GetVoiceOptions) SetCustomizationID(customizationID string) *GetVoiceOptions

SetCustomizationID : Allow user to set CustomizationID

func (*GetVoiceOptions) SetHeaders

func (options *GetVoiceOptions) SetHeaders(param map[string]string) *GetVoiceOptions

SetHeaders : Allow user to set Headers

func (*GetVoiceOptions) SetVoice

func (options *GetVoiceOptions) SetVoice(voice string) *GetVoiceOptions

SetVoice : Allow user to set Voice

type GetWordOptions

type GetWordOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// The word that is to be queried from the custom voice model.
	Word *string `json:"word" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

GetWordOptions : The GetWord options.

func (*GetWordOptions) SetCustomizationID

func (options *GetWordOptions) SetCustomizationID(customizationID string) *GetWordOptions

SetCustomizationID : Allow user to set CustomizationID

func (*GetWordOptions) SetHeaders

func (options *GetWordOptions) SetHeaders(param map[string]string) *GetWordOptions

SetHeaders : Allow user to set Headers

func (*GetWordOptions) SetWord

func (options *GetWordOptions) SetWord(word string) *GetWordOptions

SetWord : Allow user to set Word

type ListVoiceModelsOptions

type ListVoiceModelsOptions struct {

	// The language for which custom voice models that are owned by the requesting credentials are to be returned. Omit the
	// parameter to see all custom voice models that are owned by the requester.
	Language *string `json:"language,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

ListVoiceModelsOptions : The ListVoiceModels options.

func (*ListVoiceModelsOptions) SetHeaders

func (options *ListVoiceModelsOptions) SetHeaders(param map[string]string) *ListVoiceModelsOptions

SetHeaders : Allow user to set Headers

func (*ListVoiceModelsOptions) SetLanguage

func (options *ListVoiceModelsOptions) SetLanguage(language string) *ListVoiceModelsOptions

SetLanguage : Allow user to set Language

type ListVoicesOptions

type ListVoicesOptions struct {

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

ListVoicesOptions : The ListVoices options.

func (*ListVoicesOptions) SetHeaders

func (options *ListVoicesOptions) SetHeaders(param map[string]string) *ListVoicesOptions

SetHeaders : Allow user to set Headers

type ListWordsOptions

type ListWordsOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

ListWordsOptions : The ListWords options.

func (*ListWordsOptions) SetCustomizationID

func (options *ListWordsOptions) SetCustomizationID(customizationID string) *ListWordsOptions

SetCustomizationID : Allow user to set CustomizationID

func (*ListWordsOptions) SetHeaders

func (options *ListWordsOptions) SetHeaders(param map[string]string) *ListWordsOptions

SetHeaders : Allow user to set Headers

type Marks

type Marks struct {
	Marks [][]interface{} `json:"marks"`
}

Timings : An array of mark times

type Pronunciation

type Pronunciation struct {

	// The pronunciation of the specified text in the requested voice and format. If a custom voice model is specified, the
	// pronunciation also reflects that custom voice.
	Pronunciation *string `json:"pronunciation" validate:"required"`
}

Pronunciation : The pronunciation of the specified text.

type SupportedFeatures

type SupportedFeatures struct {

	// If `true`, the voice can be customized; if `false`, the voice cannot be customized. (Same as `customizable`.).
	CustomPronunciation *bool `json:"custom_pronunciation" validate:"required"`

	// If `true`, the voice can be transformed by using the SSML <voice-transformation> element; if `false`, the
	// voice cannot be transformed.
	VoiceTransformation *bool `json:"voice_transformation" validate:"required"`
}

SupportedFeatures : Additional service features that are supported with the voice.

type SynthesizeCallbackWrapper

type SynthesizeCallbackWrapper interface {
	OnOpen()
	OnError(error)
	OnContentType(string)
	OnTimingInformation(Timings)
	OnMarks(Marks)
	OnAudioStream([]byte)
	OnData(*core.DetailedResponse)
	OnClose()
}

SynthesizeCallbackWrapper : callback for synthesize using websocket

type SynthesizeListener

type SynthesizeListener struct {
	IsClosed chan bool
	Callback SynthesizeCallbackWrapper
}

func (SynthesizeListener) OnClose

func (listener SynthesizeListener) OnClose()

OnClose: Callback when websocket connection is closed

func (SynthesizeListener) OnData

func (listener SynthesizeListener) OnData(conn *websocket.Conn)

OnData: Callback when websocket connection receives data

func (SynthesizeListener) OnError

func (listener SynthesizeListener) OnError(err error)

OnError: Callback when error encountered

func (SynthesizeListener) OnOpen

func (listener SynthesizeListener) OnOpen(conn *websocket.Conn)

OnOpen: Sends start message to server when connection created

func (SynthesizeListener) SendText

func (listener SynthesizeListener) SendText(conn *websocket.Conn, req *http.Request)

SendText: Sends the text message Note: The service handles one request per connection

type SynthesizeOptions

type SynthesizeOptions struct {

	// The text to synthesize.
	Text *string `json:"text" validate:"required"`

	// The requested format (MIME type) of the audio. You can use the `Accept` header or the `accept` parameter to specify
	// the audio format. For more information about specifying an audio format, see **Audio formats (accept types)** in the
	// method description.
	Accept *string `json:"Accept,omitempty"`

	// The voice to use for synthesis.
	Voice *string `json:"voice,omitempty"`

	// The customization ID (GUID) of a custom voice model to use for the synthesis. If a custom voice model is specified,
	// it is guaranteed to work only if it matches the language of the indicated voice. You must make the request with
	// credentials for the instance of the service that owns the custom model. Omit the parameter to use the specified
	// voice with no customization.
	CustomizationID *string `json:"customization_id,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

SynthesizeOptions : The Synthesize options.

func (*SynthesizeOptions) SetAccept

func (options *SynthesizeOptions) SetAccept(accept string) *SynthesizeOptions

SetAccept : Allow user to set Accept

func (*SynthesizeOptions) SetCustomizationID

func (options *SynthesizeOptions) SetCustomizationID(customizationID string) *SynthesizeOptions

SetCustomizationID : Allow user to set CustomizationID

func (*SynthesizeOptions) SetHeaders

func (options *SynthesizeOptions) SetHeaders(param map[string]string) *SynthesizeOptions

SetHeaders : Allow user to set Headers

func (*SynthesizeOptions) SetText

func (options *SynthesizeOptions) SetText(text string) *SynthesizeOptions

SetText : Allow user to set Text

func (*SynthesizeOptions) SetVoice

func (options *SynthesizeOptions) SetVoice(voice string) *SynthesizeOptions

SetVoice : Allow user to set Voice

type SynthesizeUsingWebsocketOptions

type SynthesizeUsingWebsocketOptions struct {
	SynthesizeOptions

	// Callback to listen to events
	Callback SynthesizeCallbackWrapper `json:"callback" validate:"required"`

	// Timings specifies that the service is to return word timing information for all strings of the
	// input text. The service returns the start and end time of each string of the input. Specify words as the lone element
	// of the array to request word timings. Specify an empty array or omit the parameter to receive no word timings. For
	// more information, see [Obtaining word timings](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-timing#timing).
	// Not supported for Japanese input text.
	Timings []string `json:"action,omitempty"`
}

SynthesizeOptions : The SynthesizeUsingWebsocket options

func (*SynthesizeUsingWebsocketOptions) SetCallback

SetCallback: Allows user to set the Callback

func (*SynthesizeUsingWebsocketOptions) SetTimings

SetTimings: Allows user to set the Timings

type TextToSpeechV1

type TextToSpeechV1 struct {
	Service *core.BaseService
}

TextToSpeechV1 : The IBM® Text to Speech service provides APIs that use IBM's speech-synthesis capabilities to synthesize text into natural-sounding speech in a variety of languages, dialects, and voices. The service supports at least one male or female voice, sometimes both, for each language. The audio is streamed back to the client with minimal delay.

For speech synthesis, the service supports a synchronous HTTP Representational State Transfer (REST) interface. It also supports a WebSocket interface that provides both plain text and SSML input, including the SSML <mark> element and word timings. SSML is an XML-based markup language that provides text annotation for speech-synthesis applications.

The service also offers a customization interface. You can use the interface to define sounds-like or phonetic translations for words. A sounds-like translation consists of one or more words that, when combined, sound like the word. A phonetic translation is based on the SSML phoneme format for representing a word. You can specify a phonetic translation in standard International Phonetic Alphabet (IPA) representation or in the proprietary IBM Symbolic Phonetic Representation (SPR).

Version: 1.0.0 See: https://cloud.ibm.com/docs/services/text-to-speech/

func NewTextToSpeechV1

func NewTextToSpeechV1(options *TextToSpeechV1Options) (service *TextToSpeechV1, err error)

NewTextToSpeechV1 : Instantiate TextToSpeechV1

func (*TextToSpeechV1) AddWord

func (textToSpeech *TextToSpeechV1) AddWord(addWordOptions *AddWordOptions) (response *core.DetailedResponse, err error)

AddWord : Add a custom word Adds a single word and its translation to the specified custom voice model. Adding a new translation for a word that already exists in a custom model overwrites the word's existing translation. A custom model can contain no more than 20,000 entries. You must use credentials for the instance of the service that owns a model to add a word to it.

You can define sounds-like or phonetic translations for words. A sounds-like translation consists of one or more words that, when combined, sound like the word. Phonetic translations are based on the SSML phoneme format for representing a word. You can specify them in standard International Phonetic Alphabet (IPA) representation

<code>&lt;phoneme alphabet="ipa" ph="t&#601;m&#712;&#593;to"&gt;&lt;/phoneme&gt;</code>

or in the proprietary IBM Symbolic Phonetic Representation (SPR)

<code>&lt;phoneme alphabet="ibm" ph="1gAstroEntxrYFXs"&gt;&lt;/phoneme&gt;</code>

**Note:** This method is currently a beta release.

**See also:** * [Adding a single word to a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordAdd) * [Adding words to a Japanese custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd) * [Understanding customization](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customIntro#customIntro).

func (*TextToSpeechV1) AddWords

func (textToSpeech *TextToSpeechV1) AddWords(addWordsOptions *AddWordsOptions) (response *core.DetailedResponse, err error)

AddWords : Add custom words Adds one or more words and their translations to the specified custom voice model. Adding a new translation for a word that already exists in a custom model overwrites the word's existing translation. A custom model can contain no more than 20,000 entries. You must use credentials for the instance of the service that owns a model to add words to it.

You can define sounds-like or phonetic translations for words. A sounds-like translation consists of one or more words that, when combined, sound like the word. Phonetic translations are based on the SSML phoneme format for representing a word. You can specify them in standard International Phonetic Alphabet (IPA) representation

<code>&lt;phoneme alphabet="ipa" ph="t&#601;m&#712;&#593;to"&gt;&lt;/phoneme&gt;</code>

or in the proprietary IBM Symbolic Phonetic Representation (SPR)

<code>&lt;phoneme alphabet="ibm" ph="1gAstroEntxrYFXs"&gt;&lt;/phoneme&gt;</code>

**Note:** This method is currently a beta release.

**See also:** * [Adding multiple words to a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordsAdd) * [Adding words to a Japanese custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd) * [Understanding customization](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customIntro#customIntro).

func (*TextToSpeechV1) CreateVoiceModel

func (textToSpeech *TextToSpeechV1) CreateVoiceModel(createVoiceModelOptions *CreateVoiceModelOptions) (result *VoiceModel, response *core.DetailedResponse, err error)

CreateVoiceModel : Create a custom model Creates a new empty custom voice model. You must specify a name for the new custom model. You can optionally specify the language and a description for the new model. The model is owned by the instance of the service whose credentials are used to create it.

**Note:** This method is currently a beta release.

**See also:** [Creating a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customModels#cuModelsCreate).

func (*TextToSpeechV1) DeleteUserData

func (textToSpeech *TextToSpeechV1) DeleteUserData(deleteUserDataOptions *DeleteUserDataOptions) (response *core.DetailedResponse, err error)

DeleteUserData : Delete labeled data Deletes all data that is associated with a specified customer ID. The method deletes all data for the customer ID, regardless of the method by which the information was added. The method has no effect if no data is associated with the customer ID. You must issue the request with credentials for the same instance of the service that was used to associate the customer ID with the data.

You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request that passes the data.

**See also:** [Information security](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-information-security#information-security).

func (*TextToSpeechV1) DeleteVoiceModel

func (textToSpeech *TextToSpeechV1) DeleteVoiceModel(deleteVoiceModelOptions *DeleteVoiceModelOptions) (response *core.DetailedResponse, err error)

DeleteVoiceModel : Delete a custom model Deletes the specified custom voice model. You must use credentials for the instance of the service that owns a model to delete it.

**Note:** This method is currently a beta release.

**See also:** [Deleting a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customModels#cuModelsDelete).

func (*TextToSpeechV1) DeleteWord

func (textToSpeech *TextToSpeechV1) DeleteWord(deleteWordOptions *DeleteWordOptions) (response *core.DetailedResponse, err error)

DeleteWord : Delete a custom word Deletes a single word from the specified custom voice model. You must use credentials for the instance of the service that owns a model to delete its words.

**Note:** This method is currently a beta release.

**See also:** [Deleting a word from a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordDelete).

func (*TextToSpeechV1) DisableSSLVerification

func (textToSpeech *TextToSpeechV1) DisableSSLVerification()

DisableSSLVerification bypasses verification of the server's SSL certificate

func (*TextToSpeechV1) GetPronunciation

func (textToSpeech *TextToSpeechV1) GetPronunciation(getPronunciationOptions *GetPronunciationOptions) (result *Pronunciation, response *core.DetailedResponse, err error)

GetPronunciation : Get pronunciation Gets the phonetic pronunciation for the specified word. You can request the pronunciation for a specific format. You can also request the pronunciation for a specific voice to see the default translation for the language of that voice or for a specific custom voice model to see the translation for that voice model.

**Note:** This method is currently a beta release.

**See also:** [Querying a word from a language](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryLanguage).

func (*TextToSpeechV1) GetVoice

func (textToSpeech *TextToSpeechV1) GetVoice(getVoiceOptions *GetVoiceOptions) (result *Voice, response *core.DetailedResponse, err error)

GetVoice : Get a voice Gets information about the specified voice. The information includes the name, language, gender, and other details about the voice. Specify a customization ID to obtain information for a custom voice model that is defined for the language of the specified voice. To list information about all available voices, use the **List voices** method.

**See also:** [Listing a specific voice](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-voices#listVoice).

func (*TextToSpeechV1) GetVoiceModel

func (textToSpeech *TextToSpeechV1) GetVoiceModel(getVoiceModelOptions *GetVoiceModelOptions) (result *VoiceModel, response *core.DetailedResponse, err error)

GetVoiceModel : Get a custom model Gets all information about a specified custom voice model. In addition to metadata such as the name and description of the voice model, the output includes the words and their translations as defined in the model. To see just the metadata for a voice model, use the **List custom models** method.

**Note:** This method is currently a beta release.

**See also:** [Querying a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customModels#cuModelsQuery).

func (*TextToSpeechV1) GetWord

func (textToSpeech *TextToSpeechV1) GetWord(getWordOptions *GetWordOptions) (result *Translation, response *core.DetailedResponse, err error)

GetWord : Get a custom word Gets the translation for a single word from the specified custom model. The output shows the translation as it is defined in the model. You must use credentials for the instance of the service that owns a model to list its words.

**Note:** This method is currently a beta release.

**See also:** [Querying a single word from a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordQueryModel).

func (*TextToSpeechV1) ListVoiceModels

func (textToSpeech *TextToSpeechV1) ListVoiceModels(listVoiceModelsOptions *ListVoiceModelsOptions) (result *VoiceModels, response *core.DetailedResponse, err error)

ListVoiceModels : List custom models Lists metadata such as the name and description for all custom voice models that are owned by an instance of the service. Specify a language to list the voice models for that language only. To see the words in addition to the metadata for a specific voice model, use the **List a custom model** method. You must use credentials for the instance of the service that owns a model to list information about it.

**Note:** This method is currently a beta release.

**See also:** [Querying all custom models](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customModels#cuModelsQueryAll).

func (*TextToSpeechV1) ListVoices

func (textToSpeech *TextToSpeechV1) ListVoices(listVoicesOptions *ListVoicesOptions) (result *Voices, response *core.DetailedResponse, err error)

ListVoices : List voices Lists all voices available for use with the service. The information includes the name, language, gender, and other details about the voice. To see information about a specific voice, use the **Get a voice** method.

**See also:** [Listing all available voices](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-voices#listVoices).

func (*TextToSpeechV1) ListWords

func (textToSpeech *TextToSpeechV1) ListWords(listWordsOptions *ListWordsOptions) (result *Words, response *core.DetailedResponse, err error)

ListWords : List custom words Lists all of the words and their translations for the specified custom voice model. The output shows the translations as they are defined in the model. You must use credentials for the instance of the service that owns a model to list its words.

**Note:** This method is currently a beta release.

**See also:** [Querying all words from a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryModel).

func (*TextToSpeechV1) NewAddWordOptions

func (textToSpeech *TextToSpeechV1) NewAddWordOptions(customizationID string, word string, translation string) *AddWordOptions

NewAddWordOptions : Instantiate AddWordOptions

func (*TextToSpeechV1) NewAddWordsOptions

func (textToSpeech *TextToSpeechV1) NewAddWordsOptions(customizationID string, words []Word) *AddWordsOptions

NewAddWordsOptions : Instantiate AddWordsOptions

func (*TextToSpeechV1) NewCreateVoiceModelOptions

func (textToSpeech *TextToSpeechV1) NewCreateVoiceModelOptions(name string) *CreateVoiceModelOptions

NewCreateVoiceModelOptions : Instantiate CreateVoiceModelOptions

func (*TextToSpeechV1) NewDeleteUserDataOptions

func (textToSpeech *TextToSpeechV1) NewDeleteUserDataOptions(customerID string) *DeleteUserDataOptions

NewDeleteUserDataOptions : Instantiate DeleteUserDataOptions

func (*TextToSpeechV1) NewDeleteVoiceModelOptions

func (textToSpeech *TextToSpeechV1) NewDeleteVoiceModelOptions(customizationID string) *DeleteVoiceModelOptions

NewDeleteVoiceModelOptions : Instantiate DeleteVoiceModelOptions

func (*TextToSpeechV1) NewDeleteWordOptions

func (textToSpeech *TextToSpeechV1) NewDeleteWordOptions(customizationID string, word string) *DeleteWordOptions

NewDeleteWordOptions : Instantiate DeleteWordOptions

func (*TextToSpeechV1) NewGetPronunciationOptions

func (textToSpeech *TextToSpeechV1) NewGetPronunciationOptions(text string) *GetPronunciationOptions

NewGetPronunciationOptions : Instantiate GetPronunciationOptions

func (*TextToSpeechV1) NewGetVoiceModelOptions

func (textToSpeech *TextToSpeechV1) NewGetVoiceModelOptions(customizationID string) *GetVoiceModelOptions

NewGetVoiceModelOptions : Instantiate GetVoiceModelOptions

func (*TextToSpeechV1) NewGetVoiceOptions

func (textToSpeech *TextToSpeechV1) NewGetVoiceOptions(voice string) *GetVoiceOptions

NewGetVoiceOptions : Instantiate GetVoiceOptions

func (*TextToSpeechV1) NewGetWordOptions

func (textToSpeech *TextToSpeechV1) NewGetWordOptions(customizationID string, word string) *GetWordOptions

NewGetWordOptions : Instantiate GetWordOptions

func (*TextToSpeechV1) NewListVoiceModelsOptions

func (textToSpeech *TextToSpeechV1) NewListVoiceModelsOptions() *ListVoiceModelsOptions

NewListVoiceModelsOptions : Instantiate ListVoiceModelsOptions

func (*TextToSpeechV1) NewListVoicesOptions

func (textToSpeech *TextToSpeechV1) NewListVoicesOptions() *ListVoicesOptions

NewListVoicesOptions : Instantiate ListVoicesOptions

func (*TextToSpeechV1) NewListWordsOptions

func (textToSpeech *TextToSpeechV1) NewListWordsOptions(customizationID string) *ListWordsOptions

NewListWordsOptions : Instantiate ListWordsOptions

func (*TextToSpeechV1) NewSynthesizeListener

func (textToSpeechV1 *TextToSpeechV1) NewSynthesizeListener(callback SynthesizeCallbackWrapper, req *http.Request)

func (*TextToSpeechV1) NewSynthesizeOptions

func (textToSpeech *TextToSpeechV1) NewSynthesizeOptions(text string) *SynthesizeOptions

NewSynthesizeOptions : Instantiate SynthesizeOptions

func (*TextToSpeechV1) NewSynthesizeUsingWebsocketOptions

func (textToSpeech *TextToSpeechV1) NewSynthesizeUsingWebsocketOptions(text string, callback SynthesizeCallbackWrapper) *SynthesizeUsingWebsocketOptions

NewSynthesizeUsingWebsocketOptions: Instantiate SynthesizeOptions to enable websocket support

func (*TextToSpeechV1) NewUpdateVoiceModelOptions

func (textToSpeech *TextToSpeechV1) NewUpdateVoiceModelOptions(customizationID string) *UpdateVoiceModelOptions

NewUpdateVoiceModelOptions : Instantiate UpdateVoiceModelOptions

func (*TextToSpeechV1) SetServiceURL

func (textToSpeech *TextToSpeechV1) SetServiceURL(url string) error

SetServiceURL sets the service URL

func (*TextToSpeechV1) Synthesize

func (textToSpeech *TextToSpeechV1) Synthesize(synthesizeOptions *SynthesizeOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)

Synthesize : Synthesize audio Synthesizes text to audio that is spoken in the specified voice. The service bases its understanding of the language for the input text on the specified voice. Use a voice that matches the language of the input text.

The method accepts a maximum of 5 KB of input text in the body of the request, and 8 KB for the URL and headers. The 5 KB limit includes any SSML tags that you specify. The service returns the synthesized audio stream as an array of bytes.

**See also:** [The HTTP interface](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-usingHTTP#usingHTTP).

### Audio formats (accept types)

The service can return audio in the following formats (MIME types).

* Where indicated, you can optionally specify the sampling rate (`rate`) of the audio. You must specify a sampling rate for the `audio/l16` and `audio/mulaw` formats. A specified sampling rate must lie in the range of 8 kHz to 192 kHz. Some formats restrict the sampling rate to certain values, as noted. * For the `audio/l16` format, you can optionally specify the endianness (`endianness`) of the audio: `endianness=big-endian` or `endianness=little-endian`.

Use the `Accept` header or the `accept` parameter to specify the requested format of the response audio. If you omit an audio format altogether, the service returns the audio in Ogg format with the Opus codec (`audio/ogg;codecs=opus`). The service always returns single-channel audio. * `audio/basic` - The service returns audio with a sampling rate of 8000 Hz. * `audio/flac` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. * `audio/l16` - You must specify the `rate` of the audio. You can optionally specify the `endianness` of the audio. The default endianness is `little-endian`. * `audio/mp3` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. * `audio/mpeg` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. * `audio/mulaw` - You must specify the `rate` of the audio. * `audio/ogg` - The service returns the audio in the `vorbis` codec. You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. * `audio/ogg;codecs=opus` - You can optionally specify the `rate` of the audio. Only the following values are valid sampling rates: `48000`, `24000`, `16000`, `12000`, or `8000`. If you specify a value other than one of these, the service returns an error. The default sampling rate is 48,000 Hz. * `audio/ogg;codecs=vorbis` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. * `audio/wav` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz. * `audio/webm` - The service returns the audio in the `opus` codec. The service returns audio with a sampling rate of 48,000 Hz. * `audio/webm;codecs=opus` - The service returns audio with a sampling rate of 48,000 Hz. * `audio/webm;codecs=vorbis` - You can optionally specify the `rate` of the audio. The default sampling rate is 22,050 Hz.

For more information about specifying an audio format, including additional details about some of the formats, see [Audio formats](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-audioFormats#audioFormats).

### Warning messages

If a request includes invalid query parameters, the service returns a `Warnings` response header that provides

messages about the invalid parameters. The warning includes a descriptive message and a list of invalid argument strings. For example, a message such as `"Unknown arguments:"` or `"Unknown url query arguments:"` followed by a list of the form `"{invalid_arg_1}, {invalid_arg_2}."` The request succeeds despite the warnings.

func (*TextToSpeechV1) SynthesizeUsingWebsocket

func (textToSpeech *TextToSpeechV1) SynthesizeUsingWebsocket(synthesizeOptions *SynthesizeUsingWebsocketOptions) error

SynthesizeUsingWebsocket: Synthesize text over websocket connection

func (*TextToSpeechV1) UpdateVoiceModel

func (textToSpeech *TextToSpeechV1) UpdateVoiceModel(updateVoiceModelOptions *UpdateVoiceModelOptions) (response *core.DetailedResponse, err error)

UpdateVoiceModel : Update a custom model Updates information for the specified custom voice model. You can update metadata such as the name and description of the voice model. You can also update the words in the model and their translations. Adding a new translation for a word that already exists in a custom model overwrites the word's existing translation. A custom model can contain no more than 20,000 entries. You must use credentials for the instance of the service that owns a model to update it.

You can define sounds-like or phonetic translations for words. A sounds-like translation consists of one or more words that, when combined, sound like the word. Phonetic translations are based on the SSML phoneme format for representing a word. You can specify them in standard International Phonetic Alphabet (IPA) representation

<code>&lt;phoneme alphabet="ipa" ph="t&#601;m&#712;&#593;to"&gt;&lt;/phoneme&gt;</code>

or in the proprietary IBM Symbolic Phonetic Representation (SPR)

<code>&lt;phoneme alphabet="ibm" ph="1gAstroEntxrYFXs"&gt;&lt;/phoneme&gt;</code>

**Note:** This method is currently a beta release.

**See also:** * [Updating a custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customModels#cuModelsUpdate) * [Adding words to a Japanese custom model](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd) * [Understanding customization](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-customIntro#customIntro).

type TextToSpeechV1Options

type TextToSpeechV1Options struct {
	URL           string
	Authenticator core.Authenticator
}

TextToSpeechV1Options : Service options

type Timings

type Timings struct {
	Words [][]interface{} `json:"words,omitempty"`
}

Timings : An array of words and their start and end times in seconds from the beginning of the synthesized audio.

type Translation

type Translation struct {

	// The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for
	// representing the phonetic string of a word either as an IPA translation or as an IBM SPR translation. A sounds-like
	// is one or more words that, when combined, sound like the word.
	Translation *string `json:"translation" validate:"required"`

	// **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for
	// the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot
	// create multiple entries with different parts of speech for the same word. For more information, see [Working with
	// Japanese entries](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-rules#jaNotes).
	PartOfSpeech *string `json:"part_of_speech,omitempty"`
}

Translation : Information about the translation for the specified text.

type UpdateVoiceModelOptions

type UpdateVoiceModelOptions struct {

	// The customization ID (GUID) of the custom voice model. You must make the request with credentials for the instance
	// of the service that owns the custom model.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// A new name for the custom voice model.
	Name *string `json:"name,omitempty"`

	// A new description for the custom voice model.
	Description *string `json:"description,omitempty"`

	// An array of `Word` objects that provides the words and their translations that are to be added or updated for the
	// custom voice model. Pass an empty array to make no additions or updates.
	Words []Word `json:"words,omitempty"`

	// Allows users to set headers to be GDPR compliant
	Headers map[string]string
}

UpdateVoiceModelOptions : The UpdateVoiceModel options.

func (*UpdateVoiceModelOptions) SetCustomizationID

func (options *UpdateVoiceModelOptions) SetCustomizationID(customizationID string) *UpdateVoiceModelOptions

SetCustomizationID : Allow user to set CustomizationID

func (*UpdateVoiceModelOptions) SetDescription

func (options *UpdateVoiceModelOptions) SetDescription(description string) *UpdateVoiceModelOptions

SetDescription : Allow user to set Description

func (*UpdateVoiceModelOptions) SetHeaders

func (options *UpdateVoiceModelOptions) SetHeaders(param map[string]string) *UpdateVoiceModelOptions

SetHeaders : Allow user to set Headers

func (*UpdateVoiceModelOptions) SetName

func (options *UpdateVoiceModelOptions) SetName(name string) *UpdateVoiceModelOptions

SetName : Allow user to set Name

func (*UpdateVoiceModelOptions) SetWords

func (options *UpdateVoiceModelOptions) SetWords(words []Word) *UpdateVoiceModelOptions

SetWords : Allow user to set Words

type Voice

type Voice struct {

	// The URI of the voice.
	URL *string `json:"url" validate:"required"`

	// The gender of the voice: `male` or `female`.
	Gender *string `json:"gender" validate:"required"`

	// The name of the voice. Use this as the voice identifier in all requests.
	Name *string `json:"name" validate:"required"`

	// The language and region of the voice (for example, `en-US`).
	Language *string `json:"language" validate:"required"`

	// A textual description of the voice.
	Description *string `json:"description" validate:"required"`

	// If `true`, the voice can be customized; if `false`, the voice cannot be customized. (Same as `custom_pronunciation`;
	// maintained for backward compatibility.).
	Customizable *bool `json:"customizable" validate:"required"`

	// Additional service features that are supported with the voice.
	SupportedFeatures *SupportedFeatures `json:"supported_features" validate:"required"`

	// Returns information about a specified custom voice model. This field is returned only by the **Get a voice** method
	// and only when you specify the customization ID of a custom voice model.
	Customization *VoiceModel `json:"customization,omitempty"`
}

Voice : Information about an available voice model.

type VoiceModel

type VoiceModel struct {

	// The customization ID (GUID) of the custom voice model. The **Create a custom model** method returns only this field.
	// It does not not return the other fields of this object.
	CustomizationID *string `json:"customization_id" validate:"required"`

	// The name of the custom voice model.
	Name *string `json:"name,omitempty"`

	// The language identifier of the custom voice model (for example, `en-US`).
	Language *string `json:"language,omitempty"`

	// The GUID of the credentials for the instance of the service that owns the custom voice model.
	Owner *string `json:"owner,omitempty"`

	// The date and time in Coordinated Universal Time (UTC) at which the custom voice model was created. The value is
	// provided in full ISO 8601 format (`YYYY-MM-DDThh:mm:ss.sTZD`).
	Created *string `json:"created,omitempty"`

	// The date and time in Coordinated Universal Time (UTC) at which the custom voice model was last modified. The
	// `created` and `updated` fields are equal when a voice model is first added but has yet to be updated. The value is
	// provided in full ISO 8601 format (`YYYY-MM-DDThh:mm:ss.sTZD`).
	LastModified *string `json:"last_modified,omitempty"`

	// The description of the custom voice model.
	Description *string `json:"description,omitempty"`

	// An array of `Word` objects that lists the words and their translations from the custom voice model. The words are
	// listed in alphabetical order, with uppercase letters listed before lowercase letters. The array is empty if the
	// custom model contains no words. This field is returned only by the **Get a voice** method and only when you specify
	// the customization ID of a custom voice model.
	Words []Word `json:"words,omitempty"`
}

VoiceModel : Information about an existing custom voice model.

type VoiceModels

type VoiceModels struct {

	// An array of `VoiceModel` objects that provides information about each available custom voice model. The array is
	// empty if the requesting credentials own no custom voice models (if no language is specified) or own no custom voice
	// models for the specified language.
	Customizations []VoiceModel `json:"customizations" validate:"required"`
}

VoiceModels : Information about existing custom voice models.

type Voices

type Voices struct {

	// A list of available voices.
	Voices []Voice `json:"voices" validate:"required"`
}

Voices : Information about all available voice models.

type Word

type Word struct {

	// The word for the custom voice model.
	Word *string `json:"word" validate:"required"`

	// The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for
	// representing the phonetic string of a word either as an IPA or IBM SPR translation. A sounds-like translation
	// consists of one or more words that, when combined, sound like the word.
	Translation *string `json:"translation" validate:"required"`

	// **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for
	// the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot
	// create multiple entries with different parts of speech for the same word. For more information, see [Working with
	// Japanese entries](https://cloud.ibm.com/docs/services/text-to-speech?topic=text-to-speech-rules#jaNotes).
	PartOfSpeech *string `json:"part_of_speech,omitempty"`
}

Word : Information about a word for the custom voice model.

type Words

type Words struct {

	// The **Add custom words** method accepts an array of `Word` objects. Each object provides a word that is to be added
	// or updated for the custom voice model and the word's translation.
	//
	// The **List custom words** method returns an array of `Word` objects. Each object shows a word and its translation
	// from the custom voice model. The words are listed in alphabetical order, with uppercase letters listed before
	// lowercase letters. The array is empty if the custom model contains no words.
	Words []Word `json:"words" validate:"required"`
}

Words : For the **Add custom words** method, one or more words that are to be added or updated for the custom voice model and the translation for each specified word.

For the **List custom words** method, the words and their translations from the custom voice model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL