Documentation
¶
Index ¶
- type Client
- type CloneVoiceRequest
- type CloneVoiceResponse
- type Config
- type DesignVoiceRequest
- type DesignVoiceResponse
- type FileMeta
- type FileService
- type FileUploadRequest
- type FileUploadResponse
- type ListVoicesRequest
- type ListVoicesResponse
- type ResponseMeta
- type SpeechAsyncService
- type SpeechAsyncSubmitRequest
- type SpeechAsyncSubmitResponse
- type SpeechChunk
- type SpeechRequest
- type SpeechResponse
- type SpeechService
- func (s *SpeechService) GetAsyncTask(ctx context.Context, taskID string) (*SpeechTaskStatusResponse, error)
- func (s *SpeechService) OpenStream(ctx context.Context, request SpeechStreamRequest) (*SpeechStream, error)
- func (s *SpeechService) Stream(ctx context.Context, request SpeechStreamRequest) (*SpeechStream, error)
- func (s *SpeechService) SubmitAsync(ctx context.Context, request SpeechAsyncSubmitRequest) (*SpeechAsyncSubmitResponse, error)
- func (s *SpeechService) Synthesize(ctx context.Context, request SpeechRequest) (*SpeechResponse, error)
- type SpeechStream
- type SpeechStreamRequest
- type SpeechTaskMeta
- type SpeechTaskResult
- type SpeechTaskState
- type SpeechTaskStatusRequest
- type SpeechTaskStatusResponse
- type Voice
- type VoiceService
- func (s *VoiceService) CloneVoice(ctx context.Context, request *CloneVoiceRequest) (*CloneVoiceResponse, error)
- func (s *VoiceService) DesignVoice(ctx context.Context, request *DesignVoiceRequest) (*DesignVoiceResponse, error)
- func (s *VoiceService) ListVoices(ctx context.Context, request *ListVoicesRequest) (*ListVoicesResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Speech *SpeechService
SpeechAsync *SpeechAsyncService
File *FileService
Voice *VoiceService
// contains filtered or unexported fields
}
type CloneVoiceRequest ¶
type CloneVoiceResponse ¶
type CloneVoiceResponse struct {
ResponseMeta ResponseMeta `json:"response_meta,omitzero"`
VoiceID string `json:"voice_id,omitempty"`
DemoAudio string `json:"demo_audio,omitempty"`
Raw map[string]json.RawMessage `json:"-"`
}
type DesignVoiceRequest ¶
type DesignVoiceResponse ¶
type DesignVoiceResponse struct {
ResponseMeta ResponseMeta `json:"response_meta,omitzero"`
VoiceID string `json:"voice_id,omitempty"`
TrialAudio string `json:"trial_audio,omitempty"`
Raw map[string]json.RawMessage `json:"-"`
}
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
func (*FileService) Upload ¶
func (s *FileService) Upload(ctx context.Context, request FileUploadRequest) (*FileUploadResponse, error)
Upload uploads file bytes through multipart/form-data and returns normalized metadata.
type FileUploadRequest ¶
type FileUploadResponse ¶
type FileUploadResponse struct {
ResponseMeta ResponseMeta `json:"response_meta,omitzero"`
FileID string `json:"file_id,omitempty"`
FileURL string `json:"file_url,omitempty"`
Uploaded bool `json:"uploaded"`
Meta FileMeta `json:"meta,omitempty"`
}
type ListVoicesRequest ¶
type ListVoicesResponse ¶
type ListVoicesResponse struct {
ResponseMeta ResponseMeta `json:"response_meta,omitzero"`
Voices []Voice `json:"voices"`
NextPageToken string `json:"next_page_token,omitempty"`
HasMore bool `json:"has_more,omitempty"`
Raw map[string]json.RawMessage `json:"-"`
}
type ResponseMeta ¶
type ResponseMeta struct {
RequestID string `json:"request_id,omitempty"`
TraceID string `json:"trace_id,omitempty"`
HTTPStatus int `json:"http_status,omitempty"`
Header http.Header `json:"-"`
}
ResponseMeta contains transport-level metadata returned by Minimax APIs.
type SpeechAsyncService ¶
type SpeechAsyncService struct {
// contains filtered or unexported fields
}
func (*SpeechAsyncService) GetAsyncTask ¶
func (s *SpeechAsyncService) GetAsyncTask(ctx context.Context, taskID string) (*SpeechTaskStatusResponse, error)
GetAsyncTask queries a speech synthesis async task by task_id.
func (*SpeechAsyncService) SubmitAsync ¶
func (s *SpeechAsyncService) SubmitAsync(ctx context.Context, request SpeechAsyncSubmitRequest) (*SpeechAsyncSubmitResponse, error)
SubmitAsync creates an asynchronous speech synthesis task.
type SpeechAsyncSubmitRequest ¶
type SpeechAsyncSubmitRequest struct {
Model string `json:"model,omitempty"`
Text string `json:"text,omitempty"`
TextFileID string `json:"text_file_id,omitempty"`
VoiceID string `json:"voice_id,omitempty"`
Speed *float64 `json:"speed,omitempty"`
Vol *float64 `json:"vol,omitempty"`
Pitch *int `json:"pitch,omitempty"`
}
type SpeechAsyncSubmitResponse ¶
type SpeechAsyncSubmitResponse struct {
ResponseMeta ResponseMeta `json:"response_meta,omitzero"`
TaskID string `json:"task_id"`
Status SpeechTaskState `json:"status,omitempty"`
RawStatus string `json:"raw_status,omitempty"`
FileID string `json:"file_id,omitempty"`
TaskToken string `json:"task_token,omitempty"`
UsageCharacters *int64 `json:"usage_characters,omitempty"`
Raw map[string]json.RawMessage `json:"-"`
}
type SpeechChunk ¶
type SpeechRequest ¶
type SpeechResponse ¶
type SpeechResponse struct {
ResponseMeta ResponseMeta
Audio []byte
RawHexAudio string
}
type SpeechService ¶
type SpeechService struct {
// contains filtered or unexported fields
}
func (*SpeechService) GetAsyncTask ¶
func (s *SpeechService) GetAsyncTask(ctx context.Context, taskID string) (*SpeechTaskStatusResponse, error)
GetAsyncTask queries an asynchronous speech synthesis task through SpeechService.
func (*SpeechService) OpenStream ¶
func (s *SpeechService) OpenStream(ctx context.Context, request SpeechStreamRequest) (*SpeechStream, error)
OpenStream opens a speech synthesis stream and returns a stream reader.
func (*SpeechService) Stream ¶
func (s *SpeechService) Stream(ctx context.Context, request SpeechStreamRequest) (*SpeechStream, error)
Stream is an alias of OpenStream.
func (*SpeechService) SubmitAsync ¶
func (s *SpeechService) SubmitAsync(ctx context.Context, request SpeechAsyncSubmitRequest) (*SpeechAsyncSubmitResponse, error)
SubmitAsync creates an asynchronous speech synthesis task through SpeechService.
func (*SpeechService) Synthesize ¶
func (s *SpeechService) Synthesize(ctx context.Context, request SpeechRequest) (*SpeechResponse, error)
Synthesize performs sync TTS and returns decoded audio bytes.
type SpeechStream ¶
type SpeechStream struct {
ResponseMeta ResponseMeta
// contains filtered or unexported fields
}
SpeechStream reads speech stream events and yields decoded audio chunks.
func (*SpeechStream) Close ¶
func (s *SpeechStream) Close() error
Close closes the underlying stream body.
func (*SpeechStream) Next ¶
func (s *SpeechStream) Next() (*SpeechChunk, error)
Next returns the next speech chunk; returns io.EOF when stream completes.
type SpeechStreamRequest ¶
type SpeechStreamRequest struct {
Model string `json:"model,omitempty"`
Text string `json:"text"`
VoiceID string `json:"voice_id,omitempty"`
Speed *float64 `json:"speed,omitempty"`
Vol *float64 `json:"vol,omitempty"`
Pitch *int `json:"pitch,omitempty"`
OutputFormat string `json:"output_format,omitempty"`
}
type SpeechTaskMeta ¶
type SpeechTaskMeta struct {
DurationSeconds *float64 `json:"duration_seconds,omitempty"`
SizeBytes *int64 `json:"size_bytes,omitempty"`
Format string `json:"format,omitempty"`
SampleRate *int `json:"sample_rate,omitempty"`
Bitrate *int `json:"bitrate,omitempty"`
Channel *int `json:"channel,omitempty"`
}
type SpeechTaskResult ¶
type SpeechTaskResult struct {
FileID string `json:"file_id,omitempty"`
AudioURL string `json:"audio_url,omitempty"`
RawHexAudio string `json:"raw_hex_audio,omitempty"`
Audio []byte `json:"audio,omitempty"`
Meta SpeechTaskMeta `json:"meta,omitempty"`
}
type SpeechTaskState ¶
type SpeechTaskState string
SpeechTaskState is the normalized async speech task state.
const ( SpeechTaskStateQueued SpeechTaskState = "queued" SpeechTaskStateRunning SpeechTaskState = "running" SpeechTaskStateSucceeded SpeechTaskState = "succeeded" SpeechTaskStateFailed SpeechTaskState = "failed" )
func (SpeechTaskState) IsTerminal ¶
func (s SpeechTaskState) IsTerminal() bool
IsTerminal reports whether the task state is terminal.
type SpeechTaskStatusRequest ¶
type SpeechTaskStatusRequest struct {
TaskID string `json:"task_id"`
}
type SpeechTaskStatusResponse ¶
type SpeechTaskStatusResponse struct {
ResponseMeta ResponseMeta `json:"response_meta,omitzero"`
TaskID string `json:"task_id"`
Status SpeechTaskState `json:"status,omitempty"`
RawStatus string `json:"raw_status,omitempty"`
Result SpeechTaskResult `json:"result,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
Raw map[string]json.RawMessage `json:"-"`
}
type Voice ¶
type Voice struct {
VoiceID string `json:"voice_id,omitempty"`
VoiceName string `json:"voice_name,omitempty"`
Description []string `json:"description,omitempty"`
CreatedTime string `json:"created_time,omitempty"`
VoiceType string `json:"voice_type,omitempty"`
Raw map[string]json.RawMessage `json:"-"`
}
func (*Voice) UnmarshalJSON ¶
type VoiceService ¶
type VoiceService struct {
// contains filtered or unexported fields
}
func (*VoiceService) CloneVoice ¶
func (s *VoiceService) CloneVoice(ctx context.Context, request *CloneVoiceRequest) (*CloneVoiceResponse, error)
CloneVoice clones a voice from either an audio URL or a previously uploaded file_id.
func (*VoiceService) DesignVoice ¶
func (s *VoiceService) DesignVoice(ctx context.Context, request *DesignVoiceRequest) (*DesignVoiceResponse, error)
DesignVoice creates a new custom voice based on prompt and preview text.
func (*VoiceService) ListVoices ¶
func (s *VoiceService) ListVoices(ctx context.Context, request *ListVoicesRequest) (*ListVoicesResponse, error)
ListVoices queries available voices with filter and pagination parameters.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
file
command
|
|
|
speech
command
|
|
|
voice/clone
command
|
|
|
voice/design
command
|
|
|
voice/list
command
|
|
|
internal
|
|