stt

package
v1.783.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlibabacloudSpeechToTextProvider

type AlibabacloudSpeechToTextProvider struct {
	// contains filtered or unexported fields
}

func NewAlibabacloudSpeechToTextProvider

func NewAlibabacloudSpeechToTextProvider(typ string, subType string, secretKey string) (*AlibabacloudSpeechToTextProvider, error)

NewAlibabacloudSpeechToTextProvider creates a new instance of the Alibabacloud STT provider

func (*AlibabacloudSpeechToTextProvider) GetPricing

func (p *AlibabacloudSpeechToTextProvider) GetPricing() string

GetPricing returns the pricing information for Alibabacloud ASR service

func (*AlibabacloudSpeechToTextProvider) ProcessAudio

func (p *AlibabacloudSpeechToTextProvider) ProcessAudio(audioReader io.Reader, ctx context.Context, lang string) (string, *SpeechToTextResult, error)

ProcessAudio processes an audio stream and returns the transcribed text

type SpeechSegment

type SpeechSegment struct {
	Text       string
	BeginTime  float64
	EndTime    float64
	IsComplete bool
}

SpeechSegment represents a single segment of transcribed speech

type SpeechToTextProvider

type SpeechToTextProvider interface {
	GetPricing() string
	ProcessAudio(audioData io.Reader, ctx context.Context, lang string) (string, *SpeechToTextResult, error)
}

func GetSpeechToTextProvider

func GetSpeechToTextProvider(typ string, subType string, clientSecret string, providerUrl string) (SpeechToTextProvider, error)

GetSpeechToTextProvider creates a new provider instance based on the provider type

type SpeechToTextResult

type SpeechToTextResult struct {
	AudioDurationSeconds float64
	Price                float64
	Currency             string
}

Jump to

Keyboard shortcuts

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