microsoft

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleSpeech added in v0.1.0

func HandleSpeech(c echo.Context, options mo.Option[types.SpeechRequestOptions]) mo.Result[any]

func HandleVoices added in v0.1.0

func HandleVoices(c echo.Context, options mo.Option[types.VoicesRequestOptions]) mo.Result[any]

func ListVoices added in v0.1.12

func ListVoices(ctx context.Context, creds VoicesCredentials) ([]types.Voice, error)

ListVoices calls Azure Speech "voices/list" and maps the response to unspeech's types.Voice.

Types

type UpstreamError added in v0.1.12

type UpstreamError struct {
	StatusCode int
	Body       string
}

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.

Jump to

Keyboard shortcuts

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