Documentation
¶
Index ¶
- func HandleSpeech(c echo.Context, options mo.Option[types.SpeechRequestOptions]) mo.Result[any]
- func HandleVoices(c echo.Context, options mo.Option[types.VoicesRequestOptions]) mo.Result[any]
- func ListVoices(ctx context.Context, creds VoicesCredentials) ([]types.Voice, error)
- type UpstreamError
- type Voice
- type VoiceTagKey
- type VoicesCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleSpeech ¶ added in v0.1.0
func HandleVoices ¶ added in v0.1.0
func ListVoices ¶ added in v0.1.12
ListVoices calls Azure Speech "voices/list" and maps the response to unspeech's types.Voice.
Types ¶
type UpstreamError ¶ added in v0.1.12
UpstreamError represents a non-2xx response from Azure Speech. Callers can errors.As() this to surface upstream status to their own HTTP clients.
func (*UpstreamError) Error ¶ added in v0.1.12
func (e *UpstreamError) Error() string
type Voice ¶ added in v0.1.0
type Voice struct {
Name string `json:"Name"`
DisplayName string `json:"DisplayName"`
LocalName string `json:"LocalName"`
ShortName string `json:"ShortName"`
Gender string `json:"Gender"`
Locale string `json:"Locale"`
LocaleName string `json:"LocaleName"`
SampleRateHertz string `json:"SampleRateHertz"`
VoiceType string `json:"VoiceType"`
Status string `json:"Status"`
VoiceTag map[VoiceTagKey][]any `json:"VoiceTag"`
WordsPerMinute string `json:"WordsPerMinute"`
}
type VoiceTagKey ¶ added in v0.1.0
type VoiceTagKey string
const ( VoiceTagKeyTailoredScenarios VoiceTagKey = "TailoredScenarios" VoiceTagKeyVoicePersonalities VoiceTagKey = "VoicePersonalities" )
type VoicesCredentials ¶ added in v0.1.12
type VoicesCredentials struct {
// Region is an Azure region identifier, e.g. "eastasia".
Region string
// SubscriptionKey is the Ocp-Apim-Subscription-Key value.
SubscriptionKey string
}
VoicesCredentials are the per-request inputs needed to hit Azure Speech voices/list.
Click to show internal directories.
Click to hide internal directories.