v20190823

package
v3.0.1070+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Invalid authorization.
	AUTHFAILURE_INVALIDAUTHORIZATION = "AuthFailure.InvalidAuthorization"

	// Invalid route.
	INTERNALERROR_ERRORGETROUTE = "InternalError.ErrorGetRoute"

	// Traffic is throttled due to high load.
	INTERNALERROR_EXCEEDMAXLIMIT = "InternalError.ExceedMaxLimit"

	// Internal error.
	INTERNALERROR_INTERNALERROR = "InternalError.InternalError"

	// The request text contains invalid characters.
	INVALIDPARAMETER_INVALIDTEXT = "InvalidParameter.InvalidText"

	// Invalid `AppId`. See the description of `AppId`.
	INVALIDPARAMETERVALUE_APPID = "InvalidParameterValue.AppId"

	// The `APPID` is not registered. Activate the service in the TTS console (https://console.cloud.tencent.com/tts) first.
	INVALIDPARAMETERVALUE_APPIDNOTREGISTERED = "InvalidParameterValue.AppIdNotRegistered"

	// Invalid `Codec`. See the description of `Codec`.
	INVALIDPARAMETERVALUE_CODEC = "InvalidParameterValue.Codec"

	// The number part of the `say-as` tag of SSML is not a valid constant, which can only contain digits, ",", ".", and " " when the tag attribute is `cardinal`, `currency`, or `address`.
	INVALIDPARAMETERVALUE_ERRORCARDINALFORMAT = "InvalidParameterValue.ErrorCardinalFormat"

	// The request text contains invalid characters, or it contains no valid characters.
	INVALIDPARAMETERVALUE_INVALIDTEXT = "InvalidParameterValue.InvalidText"

	// Parameter missing.
	INVALIDPARAMETERVALUE_MISSPARAMETERS = "InvalidParameterValue.MissParameters"

	// Error in text segmentation.
	INVALIDPARAMETERVALUE_PARTICIPLEERROR = "InvalidParameterValue.ParticipleError"

	// Invalid `PrimaryLanguage`. See the description of `PrimaryLanguage`.
	INVALIDPARAMETERVALUE_PRIMARYLANGUAGE = "InvalidParameterValue.PrimaryLanguage"

	// Invalid SSML tag.
	INVALIDPARAMETERVALUE_SSMLINVALID = "InvalidParameterValue.SSMLInvalid"

	// Invalid `SampleRate`. See the description of `SampleRate`.
	INVALIDPARAMETERVALUE_SAMPLERATE = "InvalidParameterValue.SampleRate"

	// Invalid `SessionId`. See the description of `SessionId`.
	INVALIDPARAMETERVALUE_SESSIONID = "InvalidParameterValue.SessionId"

	// Invalid `Speed`. See the description of `Speed`.
	INVALIDPARAMETERVALUE_SPEED = "InvalidParameterValue.Speed"

	// Text missing.
	INVALIDPARAMETERVALUE_TEXT = "InvalidParameterValue.Text"

	// Empty text.
	INVALIDPARAMETERVALUE_TEXTEMPTY = "InvalidParameterValue.TextEmpty"

	// The text is not encoded in UTF8.
	INVALIDPARAMETERVALUE_TEXTNOTUTF8 = "InvalidParameterValue.TextNotUtf8"

	// Invalid `Type`.
	INVALIDPARAMETERVALUE_TYPE = "InvalidParameterValue.Type"

	// Invalid `VoiceType`. See the description of `VoiceType`.
	INVALIDPARAMETERVALUE_VOICETYPE = "InvalidParameterValue.VoiceType"

	// Invalid `Volume`. See the description of `Volume`.
	INVALIDPARAMETERVALUE_VOLUME = "InvalidParameterValue.Volume"

	// The request frequency exceeds the limit.
	LIMITEXCEEDED_ACCESSLIMIT = "LimitExceeded.AccessLimit"

	// Unsupported operation.
	UNSUPPORTEDOPERATION = "UnsupportedOperation"

	// Overdue payment exists.
	UNSUPPORTEDOPERATION_ACCOUNTARREARS = "UnsupportedOperation.AccountArrears"

	// Authentication expired.
	UNSUPPORTEDOPERATION_AUTHORIZATIONEXPIRED = "UnsupportedOperation.AuthorizationExpired"

	// Authentication failed.
	UNSUPPORTEDOPERATION_AUTHORIZATIONFAILED = "UnsupportedOperation.AuthorizationFailed"

	// Service prohibited.
	UNSUPPORTEDOPERATION_FORBIDDENUSE = "UnsupportedOperation.ForbiddenUse"

	// Free tier is used up.
	UNSUPPORTEDOPERATION_NOFREEACCOUNT = "UnsupportedOperation.NoFreeAccount"

	// The resource package is used up.
	UNSUPPORTEDOPERATION_PKGEXHAUSTED = "UnsupportedOperation.PkgExhausted"

	// Server opened.
	UNSUPPORTEDOPERATION_SERVERALREADYOPEN = "UnsupportedOperation.ServerAlreadyOpen"

	// The service is already terminated.
	UNSUPPORTEDOPERATION_SERVERDESTORYED = "UnsupportedOperation.ServerDestoryed"

	// Service inactivated.
	UNSUPPORTEDOPERATION_SERVERNOTOPEN = "UnsupportedOperation.ServerNotOpen"

	// Service stopped.
	UNSUPPORTEDOPERATION_SERVERSTOPPED = "UnsupportedOperation.ServerStopped"

	// The text is too long. See the description of the request parameter `Text`.
	UNSUPPORTEDOPERATION_TEXTTOOLONG = "UnsupportedOperation.TextTooLong"
)
View Source
const APIVersion = "2019-08-23"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) TextToVoice

func (c *Client) TextToVoice(request *TextToVoiceRequest) (response *TextToVoiceResponse, err error)

TextToVoice This API is used to convert any text to speech, allowing your devices and applications to talk to users.

u200bTencent Cloud Text To Speech (TTS) can synthesize speech from text in real time for many use cases, such as audiobook and news apps, voice reminders on smart devices, quick synthesis of a celebrity's voice based on existing programs or certain voice records available on the internet, and personalized vehicle navigation systems.

It is free for use in beta.

It supports SSML. For syntax details, see [SSML](https://intl.cloud.tencent.com/document/product/1073/49575?from_cn_redirect=1).

Default API request rate limit: 20 requests/sec.

error code that may be returned:

AUTHFAILURE_INVALIDAUTHORIZATION = "AuthFailure.InvalidAuthorization"
INTERNALERROR_ERRORGETROUTE = "InternalError.ErrorGetRoute"
INTERNALERROR_EXCEEDMAXLIMIT = "InternalError.ExceedMaxLimit"
INTERNALERROR_INTERNALERROR = "InternalError.InternalError"
INVALIDPARAMETER_INVALIDTEXT = "InvalidParameter.InvalidText"
INVALIDPARAMETERVALUE_APPID = "InvalidParameterValue.AppId"
INVALIDPARAMETERVALUE_APPIDNOTREGISTERED = "InvalidParameterValue.AppIdNotRegistered"
INVALIDPARAMETERVALUE_CODEC = "InvalidParameterValue.Codec"
INVALIDPARAMETERVALUE_ERRORCARDINALFORMAT = "InvalidParameterValue.ErrorCardinalFormat"
INVALIDPARAMETERVALUE_INVALIDTEXT = "InvalidParameterValue.InvalidText"
INVALIDPARAMETERVALUE_MISSPARAMETERS = "InvalidParameterValue.MissParameters"
INVALIDPARAMETERVALUE_PARTICIPLEERROR = "InvalidParameterValue.ParticipleError"
INVALIDPARAMETERVALUE_PRIMARYLANGUAGE = "InvalidParameterValue.PrimaryLanguage"
INVALIDPARAMETERVALUE_SSMLINVALID = "InvalidParameterValue.SSMLInvalid"
INVALIDPARAMETERVALUE_SAMPLERATE = "InvalidParameterValue.SampleRate"
INVALIDPARAMETERVALUE_SESSIONID = "InvalidParameterValue.SessionId"
INVALIDPARAMETERVALUE_SPEED = "InvalidParameterValue.Speed"
INVALIDPARAMETERVALUE_TEXT = "InvalidParameterValue.Text"
INVALIDPARAMETERVALUE_TEXTEMPTY = "InvalidParameterValue.TextEmpty"
INVALIDPARAMETERVALUE_TEXTNOTUTF8 = "InvalidParameterValue.TextNotUtf8"
INVALIDPARAMETERVALUE_TYPE = "InvalidParameterValue.Type"
INVALIDPARAMETERVALUE_VOICETYPE = "InvalidParameterValue.VoiceType"
INVALIDPARAMETERVALUE_VOLUME = "InvalidParameterValue.Volume"
LIMITEXCEEDED_ACCESSLIMIT = "LimitExceeded.AccessLimit"
UNSUPPORTEDOPERATION = "UnsupportedOperation"
UNSUPPORTEDOPERATION_ACCOUNTARREARS = "UnsupportedOperation.AccountArrears"
UNSUPPORTEDOPERATION_AUTHORIZATIONEXPIRED = "UnsupportedOperation.AuthorizationExpired"
UNSUPPORTEDOPERATION_AUTHORIZATIONFAILED = "UnsupportedOperation.AuthorizationFailed"
UNSUPPORTEDOPERATION_FORBIDDENUSE = "UnsupportedOperation.ForbiddenUse"
UNSUPPORTEDOPERATION_NOFREEACCOUNT = "UnsupportedOperation.NoFreeAccount"
UNSUPPORTEDOPERATION_PKGEXHAUSTED = "UnsupportedOperation.PkgExhausted"
UNSUPPORTEDOPERATION_SERVERALREADYOPEN = "UnsupportedOperation.ServerAlreadyOpen"
UNSUPPORTEDOPERATION_SERVERDESTORYED = "UnsupportedOperation.ServerDestoryed"
UNSUPPORTEDOPERATION_SERVERNOTOPEN = "UnsupportedOperation.ServerNotOpen"
UNSUPPORTEDOPERATION_SERVERSTOPPED = "UnsupportedOperation.ServerStopped"
UNSUPPORTEDOPERATION_TEXTTOOLONG = "UnsupportedOperation.TextTooLong"

func (*Client) TextToVoiceWithContext

func (c *Client) TextToVoiceWithContext(ctx context.Context, request *TextToVoiceRequest) (response *TextToVoiceResponse, err error)

TextToVoice This API is used to convert any text to speech, allowing your devices and applications to talk to users.

u200bTencent Cloud Text To Speech (TTS) can synthesize speech from text in real time for many use cases, such as audiobook and news apps, voice reminders on smart devices, quick synthesis of a celebrity's voice based on existing programs or certain voice records available on the internet, and personalized vehicle navigation systems.

It is free for use in beta.

It supports SSML. For syntax details, see [SSML](https://intl.cloud.tencent.com/document/product/1073/49575?from_cn_redirect=1).

Default API request rate limit: 20 requests/sec.

error code that may be returned:

AUTHFAILURE_INVALIDAUTHORIZATION = "AuthFailure.InvalidAuthorization"
INTERNALERROR_ERRORGETROUTE = "InternalError.ErrorGetRoute"
INTERNALERROR_EXCEEDMAXLIMIT = "InternalError.ExceedMaxLimit"
INTERNALERROR_INTERNALERROR = "InternalError.InternalError"
INVALIDPARAMETER_INVALIDTEXT = "InvalidParameter.InvalidText"
INVALIDPARAMETERVALUE_APPID = "InvalidParameterValue.AppId"
INVALIDPARAMETERVALUE_APPIDNOTREGISTERED = "InvalidParameterValue.AppIdNotRegistered"
INVALIDPARAMETERVALUE_CODEC = "InvalidParameterValue.Codec"
INVALIDPARAMETERVALUE_ERRORCARDINALFORMAT = "InvalidParameterValue.ErrorCardinalFormat"
INVALIDPARAMETERVALUE_INVALIDTEXT = "InvalidParameterValue.InvalidText"
INVALIDPARAMETERVALUE_MISSPARAMETERS = "InvalidParameterValue.MissParameters"
INVALIDPARAMETERVALUE_PARTICIPLEERROR = "InvalidParameterValue.ParticipleError"
INVALIDPARAMETERVALUE_PRIMARYLANGUAGE = "InvalidParameterValue.PrimaryLanguage"
INVALIDPARAMETERVALUE_SSMLINVALID = "InvalidParameterValue.SSMLInvalid"
INVALIDPARAMETERVALUE_SAMPLERATE = "InvalidParameterValue.SampleRate"
INVALIDPARAMETERVALUE_SESSIONID = "InvalidParameterValue.SessionId"
INVALIDPARAMETERVALUE_SPEED = "InvalidParameterValue.Speed"
INVALIDPARAMETERVALUE_TEXT = "InvalidParameterValue.Text"
INVALIDPARAMETERVALUE_TEXTEMPTY = "InvalidParameterValue.TextEmpty"
INVALIDPARAMETERVALUE_TEXTNOTUTF8 = "InvalidParameterValue.TextNotUtf8"
INVALIDPARAMETERVALUE_TYPE = "InvalidParameterValue.Type"
INVALIDPARAMETERVALUE_VOICETYPE = "InvalidParameterValue.VoiceType"
INVALIDPARAMETERVALUE_VOLUME = "InvalidParameterValue.Volume"
LIMITEXCEEDED_ACCESSLIMIT = "LimitExceeded.AccessLimit"
UNSUPPORTEDOPERATION = "UnsupportedOperation"
UNSUPPORTEDOPERATION_ACCOUNTARREARS = "UnsupportedOperation.AccountArrears"
UNSUPPORTEDOPERATION_AUTHORIZATIONEXPIRED = "UnsupportedOperation.AuthorizationExpired"
UNSUPPORTEDOPERATION_AUTHORIZATIONFAILED = "UnsupportedOperation.AuthorizationFailed"
UNSUPPORTEDOPERATION_FORBIDDENUSE = "UnsupportedOperation.ForbiddenUse"
UNSUPPORTEDOPERATION_NOFREEACCOUNT = "UnsupportedOperation.NoFreeAccount"
UNSUPPORTEDOPERATION_PKGEXHAUSTED = "UnsupportedOperation.PkgExhausted"
UNSUPPORTEDOPERATION_SERVERALREADYOPEN = "UnsupportedOperation.ServerAlreadyOpen"
UNSUPPORTEDOPERATION_SERVERDESTORYED = "UnsupportedOperation.ServerDestoryed"
UNSUPPORTEDOPERATION_SERVERNOTOPEN = "UnsupportedOperation.ServerNotOpen"
UNSUPPORTEDOPERATION_SERVERSTOPPED = "UnsupportedOperation.ServerStopped"
UNSUPPORTEDOPERATION_TEXTTOOLONG = "UnsupportedOperation.TextTooLong"

type Subtitle

type Subtitle struct {
	// The word in the text that is sent.
	Text *string `json:"Text,omitnil,omitempty" name:"Text"`

	// The start timestamp of the word in the synthesized audio data, in milliseconds.
	BeginTime *int64 `json:"BeginTime,omitnil,omitempty" name:"BeginTime"`

	// The end timestamp of the word in the synthesized audio data, in milliseconds.
	EndTime *int64 `json:"EndTime,omitnil,omitempty" name:"EndTime"`

	// The start index of the character in the whole sentence, starting from 0.
	BeginIndex *int64 `json:"BeginIndex,omitnil,omitempty" name:"BeginIndex"`

	// The end index of the character in the whole sentence, starting from 0.
	EndIndex *int64 `json:"EndIndex,omitnil,omitempty" name:"EndIndex"`

	// The phonemes of the word.
	// Note: This field may return null, indicating that no valid values can be obtained.
	Phoneme *string `json:"Phoneme,omitnil,omitempty" name:"Phoneme"`
}

type TextToVoiceRequest

type TextToVoiceRequest struct {
	*tchttp.BaseRequest

	// The source text for synthesizing speech, which is encoded in UTF-8.
	// It can contain up to 150 Chinese characters (a full-width punctuation as a Chinese character) or 500 letters ( a half-width punctuation as a letter).
	Text *string `json:"Text,omitnil,omitempty" name:"Text"`

	// The `SessionId` of a request, which will be returned as-is. We recommend that you pass characters like uuid to prevent repetition.
	SessionId *string `json:"SessionId,omitnil,omitempty" name:"SessionId"`

	// Volume range: [0, 10], corresponding to 11 volume levels. 0 is the default value, indicating the normal volume. There is no mute option.
	Volume *float64 `json:"Volume,omitnil,omitempty" name:"Volume"`

	// Speed range: [-2, 6], corresponding to different speeds<li>-2 for 0.6 times</li><li>-1 for 0.8 times</li><li>0 for 1.0 time (default)</li><li>1 for 1.2 times</li><li>2 for 1.5 times</li><li>6 for 2.5 times</li>To set finer-grained speed levels, keep one decimal place, such as 0.5, 1.1, and 1.8.<br>
	Speed *float64 `json:"Speed,omitnil,omitempty" name:"Speed"`

	// Project ID, which defaults to 0 and can be customized.
	ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"`

	// Model type, with `1` for the default model.
	ModelType *int64 `json:"ModelType,omitnil,omitempty" name:"ModelType"`

	// Standard voices <li>10510000-zhixiaoyao (Chinese)</li><li>1001-zhiyu (Chinese)</li><li>1002-zhiling (Chinese)</li><li>1003-zhimei (Chinese)</li><li>1004-zhiyun (Chinese)</li><li>1005-zhili (Chinese)</li><li>1007-zhina (Chinese)</li><li>1008-zhiqi (Chinese)</li><li>1009-zhiyun (Chinese)</li><li>1010-zhihua (Chinese)</li><li>1017-zhirong (Chinese)</li><li>1018-zhijing (Chinese)</li><li>1050-WeJack (English)</li><li>1051-WeRose (English)</li>Premium voices<br>Premium voices have higher fidelity and more natural-sounding quality than standard voices. For price details, see [Purchase Guide](https://www.tencentcloud.com/document/product/1154/47874).<br><li>100510000-zhixiaoyao (Chinese)</li><li>101001-zhiyu (Chinese)</li><li>101002-zhiling (Chinese)</li><li>101003-zhimei (Chinese)</li><li>101004-zhiyun (Chinese)</li><li>101005-zhili (Chinese)</li><li>101006-zhiyan (Chinese)</li><li>101007-zhina (Chinese)</li><li>101008-zhiqi (Chinese)</li><li>101009-zhiyun (Chinese)</li><li>101010-zhihua (Chinese)</li><li>101011-zhiyan (Chinese)</li><li>101012-zhidan (Chinese)</li><li>101013-zhihui (Chinese)</li><li>101014-zhining (Chinese)</li><li>101015-zhimeng (Chinese)</li><li>101016-zhitian (Chinese)</li><li>101017-zhirong (Chinese)</li><li>101018-zhijing (Chinese)</li><li>101019-zhitong (Cantonese)</li><li>101020-zhigang (Chinese)</li><li>101021-zhirui (Chinese)</li><li>101022-zhihong (Chinese)</li><li>101023-zhixuan (Chinese)</li><li>101024-zhihao (Chinese)</li><li>101025-zhiwei (Chinese)</li><li>101026-zhixi (Chinese)</li><li>101027-zhimei (Chinese)</li><li>101028-zhijie (Chinese)</li><li>101029-zhikai (Chinese)</li><li>101030-zhike (Chinese)</li><li>101031-zhikui (Chinese)</li><li>101032-zhifang (Chinese)</li><li>101033-zhibei (Chinese)</li><li>101034-zhilian (Chinese)</li><li>101035-zhiyi (Chinese)</li><li>101040-zhichuan (Sichuan dialect)</li><li>101050-WeJack (English)</li><li>101051-WeRose (English)</li><li>101052-zhiwei (Chinese)</li>
	// <li>101053-zhifang (Chinese)</li>
	// <li>101054-zhiyou (Chinese)</li>
	// <li>101055-zhiyou (Chinese)</li>
	// <li>101056-zhilin (Northeastern Mandarin)</li>
	VoiceType *int64 `json:"VoiceType,omitnil,omitempty" name:"VoiceType"`

	// Primary language type: <li>1 - Chinese (default)</li><li>2 - English</li>
	PrimaryLanguage *int64 `json:"PrimaryLanguage,omitnil,omitempty" name:"PrimaryLanguage"`

	// Audio sample rate: <li>16000: 16k (default)</li><li>8000: 8k</li>
	SampleRate *uint64 `json:"SampleRate,omitnil,omitempty" name:"SampleRate"`

	// Format of returned audio. Valid values: WAV (default), MP3, and PCM.
	Codec *string `json:"Codec,omitnil,omitempty" name:"Codec"`

	// Whether to enable the timestamp feature. Default value: `false`.
	EnableSubtitle *bool `json:"EnableSubtitle,omitnil,omitempty" name:"EnableSubtitle"`

	// The threshold of speech segmentation sensibility, which can be `0` (default), `1`, or `2`. A larger value indicates fewer segments, and the model tends to only segment sentences based on punctuation marks. We recommend you not change this parameter to avoid adverse effect on speech synthesis.
	SegmentRate *uint64 `json:"SegmentRate,omitnil,omitempty" name:"SegmentRate"`
}

func NewTextToVoiceRequest

func NewTextToVoiceRequest() (request *TextToVoiceRequest)

func (*TextToVoiceRequest) FromJsonString

func (r *TextToVoiceRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*TextToVoiceRequest) ToJsonString

func (r *TextToVoiceRequest) ToJsonString() string

type TextToVoiceRequestParams

type TextToVoiceRequestParams struct {
	// The source text for synthesizing speech, which is encoded in UTF-8.
	// It can contain up to 150 Chinese characters (a full-width punctuation as a Chinese character) or 500 letters ( a half-width punctuation as a letter).
	Text *string `json:"Text,omitnil,omitempty" name:"Text"`

	// The `SessionId` of a request, which will be returned as-is. We recommend that you pass characters like uuid to prevent repetition.
	SessionId *string `json:"SessionId,omitnil,omitempty" name:"SessionId"`

	// Volume range: [0, 10], corresponding to 11 volume levels. 0 is the default value, indicating the normal volume. There is no mute option.
	Volume *float64 `json:"Volume,omitnil,omitempty" name:"Volume"`

	// Speed range: [-2, 6], corresponding to different speeds<li>-2 for 0.6 times</li><li>-1 for 0.8 times</li><li>0 for 1.0 time (default)</li><li>1 for 1.2 times</li><li>2 for 1.5 times</li><li>6 for 2.5 times</li>To set finer-grained speed levels, keep one decimal place, such as 0.5, 1.1, and 1.8.<br>
	Speed *float64 `json:"Speed,omitnil,omitempty" name:"Speed"`

	// Project ID, which defaults to 0 and can be customized.
	ProjectId *int64 `json:"ProjectId,omitnil,omitempty" name:"ProjectId"`

	// Model type, with `1` for the default model.
	ModelType *int64 `json:"ModelType,omitnil,omitempty" name:"ModelType"`

	// Standard voices <li>10510000-zhixiaoyao (Chinese)</li><li>1001-zhiyu (Chinese)</li><li>1002-zhiling (Chinese)</li><li>1003-zhimei (Chinese)</li><li>1004-zhiyun (Chinese)</li><li>1005-zhili (Chinese)</li><li>1007-zhina (Chinese)</li><li>1008-zhiqi (Chinese)</li><li>1009-zhiyun (Chinese)</li><li>1010-zhihua (Chinese)</li><li>1017-zhirong (Chinese)</li><li>1018-zhijing (Chinese)</li><li>1050-WeJack (English)</li><li>1051-WeRose (English)</li>Premium voices<br>Premium voices have higher fidelity and more natural-sounding quality than standard voices. For price details, see [Purchase Guide](https://www.tencentcloud.com/document/product/1154/47874).<br><li>100510000-zhixiaoyao (Chinese)</li><li>101001-zhiyu (Chinese)</li><li>101002-zhiling (Chinese)</li><li>101003-zhimei (Chinese)</li><li>101004-zhiyun (Chinese)</li><li>101005-zhili (Chinese)</li><li>101006-zhiyan (Chinese)</li><li>101007-zhina (Chinese)</li><li>101008-zhiqi (Chinese)</li><li>101009-zhiyun (Chinese)</li><li>101010-zhihua (Chinese)</li><li>101011-zhiyan (Chinese)</li><li>101012-zhidan (Chinese)</li><li>101013-zhihui (Chinese)</li><li>101014-zhining (Chinese)</li><li>101015-zhimeng (Chinese)</li><li>101016-zhitian (Chinese)</li><li>101017-zhirong (Chinese)</li><li>101018-zhijing (Chinese)</li><li>101019-zhitong (Cantonese)</li><li>101020-zhigang (Chinese)</li><li>101021-zhirui (Chinese)</li><li>101022-zhihong (Chinese)</li><li>101023-zhixuan (Chinese)</li><li>101024-zhihao (Chinese)</li><li>101025-zhiwei (Chinese)</li><li>101026-zhixi (Chinese)</li><li>101027-zhimei (Chinese)</li><li>101028-zhijie (Chinese)</li><li>101029-zhikai (Chinese)</li><li>101030-zhike (Chinese)</li><li>101031-zhikui (Chinese)</li><li>101032-zhifang (Chinese)</li><li>101033-zhibei (Chinese)</li><li>101034-zhilian (Chinese)</li><li>101035-zhiyi (Chinese)</li><li>101040-zhichuan (Sichuan dialect)</li><li>101050-WeJack (English)</li><li>101051-WeRose (English)</li><li>101052-zhiwei (Chinese)</li>
	// <li>101053-zhifang (Chinese)</li>
	// <li>101054-zhiyou (Chinese)</li>
	// <li>101055-zhiyou (Chinese)</li>
	// <li>101056-zhilin (Northeastern Mandarin)</li>
	VoiceType *int64 `json:"VoiceType,omitnil,omitempty" name:"VoiceType"`

	// Primary language type: <li>1 - Chinese (default)</li><li>2 - English</li>
	PrimaryLanguage *int64 `json:"PrimaryLanguage,omitnil,omitempty" name:"PrimaryLanguage"`

	// Audio sample rate: <li>16000: 16k (default)</li><li>8000: 8k</li>
	SampleRate *uint64 `json:"SampleRate,omitnil,omitempty" name:"SampleRate"`

	// Format of returned audio. Valid values: WAV (default), MP3, and PCM.
	Codec *string `json:"Codec,omitnil,omitempty" name:"Codec"`

	// Whether to enable the timestamp feature. Default value: `false`.
	EnableSubtitle *bool `json:"EnableSubtitle,omitnil,omitempty" name:"EnableSubtitle"`

	// The threshold of speech segmentation sensibility, which can be `0` (default), `1`, or `2`. A larger value indicates fewer segments, and the model tends to only segment sentences based on punctuation marks. We recommend you not change this parameter to avoid adverse effect on speech synthesis.
	SegmentRate *uint64 `json:"SegmentRate,omitnil,omitempty" name:"SegmentRate"`
}

Predefined struct for user

type TextToVoiceResponse

type TextToVoiceResponse struct {
	*tchttp.BaseResponse
	Response *TextToVoiceResponseParams `json:"Response"`
}

func NewTextToVoiceResponse

func NewTextToVoiceResponse() (response *TextToVoiceResponse)

func (*TextToVoiceResponse) FromJsonString

func (r *TextToVoiceResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*TextToVoiceResponse) ToJsonString

func (r *TextToVoiceResponse) ToJsonString() string

type TextToVoiceResponseParams

type TextToVoiceResponseParams struct {
	// Base64-encoded WAV/MP3 audio data
	Audio *string `json:"Audio,omitnil,omitempty" name:"Audio"`

	// The `SessionId` of a request
	SessionId *string `json:"SessionId,omitnil,omitempty" name:"SessionId"`

	// Timestamp information. If the timestamp feature is not enabled, an empty array will be returned.
	Subtitles []*Subtitle `json:"Subtitles,omitnil,omitempty" name:"Subtitles"`

	// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

Predefined struct for user

Jump to

Keyboard shortcuts

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