transcribe

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 50 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Transcribe

Parity grade: A · SDK aws-sdk-go-v2/service/transcribe@v1.66.4 · last audited 2026-10-07 (7480cad08)

Coverage

Metric Value
PARITY entries audited 44 (44 ok)
Feature families 8 (8 ok)
Known gaps 6
Structural gaps (can't be emulated) 2
Deferred items 0
Resource leaks clean
Known gaps
  • StartMedicalScribeJob completes at once and reports s3:///-transcript.json and -clinical-document.json without writing either object. Blockers: the clinical document is generated by AWS HealthScribe's generative model and cannot be reproduced; API_MedicalScribeOutput.html makes both URIs required and documents neither the object keys nor the transcript schema (handler_medical_scribe.go buildMedicalScribeOutputLocations, medical_scribe.go StartMedicalScribeJob)
  • Under the docker engine, ShowSpeakerLabels, ContentRedaction and MedicalContentIdentificationType jobs FAIL (the Vosk server exposes no diarization or PII detection, engine_vosk.go; pipeline.go recognize); custom vocabularies and custom language models are not applied to recognition (no Vosk hotword or model-adaptation API). Vocabulary filters (mask, remove, tag) are applied to transcription and call analytics words.
  • IdentifyLanguage/IdentifyMultipleLanguages report the first LanguageOptions entry with a fixed IdentifiedLanguageScore; the Vosk server has no language identification (transcription_jobs.go syntheticIdentifiedLanguageScore)
  • Docker engine cannot decode MP4/M4A (AAC), AMR, WebM or Ogg Opus: no maintained pure-Go decoder is in go.mod (pipeline.go recognize fails those jobs). Call Analytics sentiment, loudness, talk-time, categories and summaries are not produced.
  • Emulator limit: the docker engine takes one PCM buffer per channel, so decoded audio is capped at 64 MiB of 16 kHz 16-bit PCM across all channels (about 33 minutes mono, 16 minutes per channel for two channels); longer jobs fail with "Invalid file size: file size too large" although AWS accepts up to 4 hours (audio_decode.go maxDecodedBytes). The media object is still read whole, up to the 2 GB limit, before decoding.
  • Medical transcript and Call Analytics JSON follow the batch schema and the documented post-call field names respectively; PHI entity annotations and the Categories/IssuesDetected sections are not emitted (unverified against a live AWS document).
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • CallAnalyticsJobDetails.Skipped: skipped features (insufficient conversation content, safety guidelines) come from analysing real audio; the emulator evaluates none of the Call Analytics features.
  • OutputEncryptionKMSKeyId on StartCallAnalyticsJob, StartMedicalScribeJob and StartMedicalTranscriptionJob: no response type echoes the key and no S3/KMS output pipeline exists to encrypt with it.

More

Documentation

Index

Constants

View Source
const (
	EngineStub   = "stub"
	EngineDocker = "docker"
)

Engine modes for speech recognition.

View Source
const DefaultVoskImage = "alphacep/kaldi-vosk-server@" +
	"sha256:381024347b954835c9c20adea2041377e7b55f50d4c5887eb42101bbf6e750a1"

DefaultVoskImage is the pinned Vosk server image; Python 3 with the vosk module is all the engine uses.

Variables

View Source
var (
	// ErrNotFound is returned when a transcription job is not found.
	ErrNotFound = awserr.New("NotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource with the given name already exists.
	ErrAlreadyExists = awserr.New("ConflictException", awserr.ErrAlreadyExists)
	// ErrValidation is returned for invalid or missing input parameters.
	ErrValidation = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
	// ErrVocabularyNotFound is returned when a vocabulary is not found.
	// Real AWS returns BadRequestException (400) for missing vocabularies, not NotFoundException (404).
	ErrVocabularyNotFound = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
)
View Source
var ErrMediaNotFound = errors.New("media object not found")

ErrMediaNotFound is returned by a MediaReader when the media object does not exist or is unreadable.

View Source
var ErrNilAppContext = errors.New("transcribe: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AbsoluteTimeRange added in v1.3.1

type AbsoluteTimeRange struct {
	EndTime   *int64 `json:"EndTime,omitempty"`
	First     *int64 `json:"First,omitempty"`
	Last      *int64 `json:"Last,omitempty"`
	StartTime *int64 `json:"StartTime,omitempty"`
}

AbsoluteTimeRange specifies a time range in milliseconds within a call analytics rule filter.

type CallAnalyticsCategory

type CallAnalyticsCategory struct {
	CreateTime     time.Time           `json:"createTime"`
	LastUpdateTime time.Time           `json:"lastUpdateTime"`
	Tags           map[string]string   `json:"tags,omitempty"`
	CategoryName   string              `json:"categoryName"`
	InputType      string              `json:"inputType"`
	Rules          []CallAnalyticsRule `json:"rules,omitempty"`
}

CallAnalyticsCategory represents an Amazon Transcribe Call Analytics category.

type CallAnalyticsJob

type CallAnalyticsJob struct {
	StartTime               time.Time              `json:"startTime"`
	CompletionTime          time.Time              `json:"completionTime"`
	CreationTime            time.Time              `json:"creationTime"`
	Tags                    map[string]string      `json:"tags,omitempty"`
	Settings                *CallAnalyticsSettings `json:"settings,omitempty"`
	Media                   Media                  `json:"media"`
	CallAnalyticsJobStatus  string                 `json:"callAnalyticsJobStatus"`
	LanguageCode            string                 `json:"languageCode"`
	MediaFormat             string                 `json:"mediaFormat,omitempty"`
	DataAccessRoleArn       string                 `json:"dataAccessRoleArn,omitempty"`
	FailureReason           string                 `json:"failureReason,omitempty"`
	CallAnalyticsJobName    string                 `json:"callAnalyticsJobName"`
	OutputLocation          string                 `json:"outputLocation,omitempty"`
	ChannelDefinitions      []ChannelDefinition    `json:"channelDefinitions,omitempty"`
	ManagedOutputs          map[string][]byte      `json:"managedOutputs,omitempty"`
	TranscriptFileURI       string                 `json:"transcriptFileUri,omitempty"`
	RedactedTranscriptURI   string                 `json:"redactedTranscriptFileUri,omitempty"`
	ManagedToken            string                 `json:"managedToken,omitempty"`
	TranscriptJSON          []byte                 `json:"transcriptJson,omitempty"`
	IdentifiedLanguageScore float32                `json:"identifiedLanguageScore,omitempty"`
	MediaSampleRateHertz    int32                  `json:"mediaSampleRateHertz,omitempty"`
}

CallAnalyticsJob represents an Amazon Transcribe Call Analytics job.

type CallAnalyticsRule

type CallAnalyticsRule struct {
	NonTalkTimeFilter  *NonTalkTimeFilter  `json:"NonTalkTimeFilter,omitempty"`
	InterruptionFilter *InterruptionFilter `json:"InterruptionFilter,omitempty"`
	TranscriptFilter   *TranscriptFilter   `json:"TranscriptFilter,omitempty"`
	SentimentFilter    *SentimentFilter    `json:"SentimentFilter,omitempty"`
}

CallAnalyticsRule is a rule in a call analytics category.

type CallAnalyticsSettings

type CallAnalyticsSettings struct {
	ContentRedaction       *ContentRedaction             `json:"ContentRedaction,omitempty"`
	Summarization          *SummarizationSettings        `json:"Summarization,omitempty"`
	LanguageIDSettings     map[string]LanguageIDSettings `json:"LanguageIdSettings,omitempty"`
	VocabularyName         string                        `json:"VocabularyName,omitempty"`
	VocabularyFilterName   string                        `json:"VocabularyFilterName,omitempty"`
	VocabularyFilterMethod string                        `json:"VocabularyFilterMethod,omitempty"`
	LanguageModelName      string                        `json:"LanguageModelName,omitempty"`
	LanguageOptions        []string                      `json:"LanguageOptions,omitempty"`
}

CallAnalyticsSettings holds settings for a call analytics job.

type ChannelDefinition

type ChannelDefinition struct {
	ParticipantRole string `json:"ParticipantRole"`
	ChannelID       int32  `json:"ChannelId"`
}

ChannelDefinition defines a channel in a call analytics job.

type ClinicalNoteGenerationSettings

type ClinicalNoteGenerationSettings struct {
	NoteTemplate string `json:"NoteTemplate,omitempty"`
}

ClinicalNoteGenerationSettings controls clinical note generation in medical scribe.

type ConfigProvider

type ConfigProvider interface {
	GetTranscribeSettings() Settings
}

ConfigProvider supplies Transcribe settings from the application config.

type ContentRedaction

type ContentRedaction struct {
	RedactionType   string   `json:"RedactionType"`
	RedactionOutput string   `json:"RedactionOutput,omitempty"`
	PiiEntityTypes  []string `json:"PiiEntityTypes,omitempty"`
}

ContentRedaction represents content redaction settings for a transcription job.

type EncryptionConfig

type EncryptionConfig struct {
	KMSEncryptionContext map[string]string `json:"KMSEncryptionContext,omitempty"`
	KMSKey               string            `json:"KMSKey"`
}

EncryptionConfig is types.EncryptionConfiguration.

type Engine

type Engine interface {
	// SupportsLanguage reports whether the engine has a model for the Transcribe language code.
	SupportsLanguage(code string) bool
	// Recognize transcribes one mono channel.
	Recognize(ctx context.Context, language string, sampleRate int, pcm []byte) ([]Word, error)
}

Engine turns mono 16-bit little-endian PCM into timed words.

type EngineRuntime

type EngineRuntime interface {
	HasImage(ctx context.Context, ref string) (bool, error)
	PullImage(ctx context.Context, ref string) error
	CreateAndStart(ctx context.Context, spec container.Spec) (string, error)
	StopAndRemove(ctx context.Context, id string) error
	Exec(ctx context.Context, id string, cmd []string) (container.ExecResult, error)
}

EngineRuntime is the slice of container.Runtime the Vosk engine uses.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for Amazon Transcribe operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Transcribe handler.

func (*Handler) BackendFor

func (h *Handler) BackendFor(region string) StorageBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this Transcribe instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the Transcribe action from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the primary resource name from the request body.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported Transcribe operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler serves each request from the handler of its region.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches Transcribe requests.

func (*Handler) ServeManagedOutput

func (h *Handler) ServeManagedOutput(c *echo.Context) error

ServeManagedOutput serves a service-managed transcript, standing in for the presigned S3 URL real Transcribe returns.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops in-flight recognition runs in every region.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable; other regions ride in an additive "regions" key.

type InMemoryBackend

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

InMemoryBackend is the in-memory store for Transcribe jobs.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func NewInMemoryBackendForRegion

func NewInMemoryBackendForRegion(region string) *InMemoryBackend

NewInMemoryBackendForRegion creates a backend whose resource ARNs name region.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the synthetic AWS account ID used by this backend.

func (*InMemoryBackend) AddCallAnalyticsCategoryInternal

func (b *InMemoryBackend) AddCallAnalyticsCategoryInternal(cat *CallAnalyticsCategory)

AddCallAnalyticsCategoryInternal seeds a Call Analytics category directly (test helper).

func (*InMemoryBackend) AddCallAnalyticsJobInternal

func (b *InMemoryBackend) AddCallAnalyticsJobInternal(job *CallAnalyticsJob)

AddCallAnalyticsJobInternal seeds a Call Analytics job directly (test helper).

func (*InMemoryBackend) AddLanguageModelInternal

func (b *InMemoryBackend) AddLanguageModelInternal(m *LanguageModel)

AddLanguageModelInternal seeds a language model directly (test helper).

func (*InMemoryBackend) AddMedicalScribeJobInternal

func (b *InMemoryBackend) AddMedicalScribeJobInternal(job *MedicalScribeJob)

AddMedicalScribeJobInternal seeds a Medical Scribe job directly (test helper).

func (*InMemoryBackend) AddMedicalTranscriptionJobInternal

func (b *InMemoryBackend) AddMedicalTranscriptionJobInternal(job *MedicalTranscriptionJob)

AddMedicalTranscriptionJobInternal seeds a Medical Transcription job directly (test helper).

func (*InMemoryBackend) AddMedicalVocabularyInternal

func (b *InMemoryBackend) AddMedicalVocabularyInternal(v *MedicalVocabulary)

AddMedicalVocabularyInternal seeds a medical vocabulary directly (test helper).

func (*InMemoryBackend) AddVocabularyFilterInternal

func (b *InMemoryBackend) AddVocabularyFilterInternal(f *VocabularyFilter)

AddVocabularyFilterInternal seeds a vocabulary filter directly (test helper).

func (*InMemoryBackend) AddVocabularyInternal

func (b *InMemoryBackend) AddVocabularyInternal(v *Vocabulary)

AddVocabularyInternal seeds a vocabulary directly (test helper).

func (*InMemoryBackend) CreateCallAnalyticsCategory

func (b *InMemoryBackend) CreateCallAnalyticsCategory(input *CallAnalyticsCategory) (*CallAnalyticsCategory, error)

CreateCallAnalyticsCategory creates a new Call Analytics category.

func (*InMemoryBackend) CreateLanguageModel

func (b *InMemoryBackend) CreateLanguageModel(input *LanguageModel) (*LanguageModel, error)

CreateLanguageModel creates a new custom language model.

func (*InMemoryBackend) CreateMedicalVocabulary

func (b *InMemoryBackend) CreateMedicalVocabulary(
	vocabularyName, languageCode, vocabularyFileURI string, tags map[string]string,
) (*MedicalVocabulary, error)

CreateMedicalVocabulary creates a new medical custom vocabulary.

func (*InMemoryBackend) CreateVocabulary

func (b *InMemoryBackend) CreateVocabulary(input *Vocabulary) (*Vocabulary, error)

CreateVocabulary creates a new custom vocabulary.

func (*InMemoryBackend) CreateVocabularyFilter

func (b *InMemoryBackend) CreateVocabularyFilter(input *VocabularyFilter) (*VocabularyFilter, error)

CreateVocabularyFilter creates a new custom vocabulary filter.

func (*InMemoryBackend) DeleteCallAnalyticsCategory

func (b *InMemoryBackend) DeleteCallAnalyticsCategory(categoryName string) error

DeleteCallAnalyticsCategory removes a Call Analytics category by name.

func (*InMemoryBackend) DeleteCallAnalyticsJob

func (b *InMemoryBackend) DeleteCallAnalyticsJob(jobName string) error

DeleteCallAnalyticsJob removes a Call Analytics job by name.

func (*InMemoryBackend) DeleteLanguageModel

func (b *InMemoryBackend) DeleteLanguageModel(modelName string) error

DeleteLanguageModel removes a custom language model by name.

func (*InMemoryBackend) DeleteMedicalScribeJob

func (b *InMemoryBackend) DeleteMedicalScribeJob(jobName string) error

DeleteMedicalScribeJob removes a Medical Scribe job by name.

func (*InMemoryBackend) DeleteMedicalTranscriptionJob

func (b *InMemoryBackend) DeleteMedicalTranscriptionJob(jobName string) error

DeleteMedicalTranscriptionJob removes a medical transcription job by name.

func (*InMemoryBackend) DeleteMedicalVocabulary

func (b *InMemoryBackend) DeleteMedicalVocabulary(vocabularyName string) error

DeleteMedicalVocabulary removes a medical vocabulary by name.

func (*InMemoryBackend) DeleteTranscriptionJob

func (b *InMemoryBackend) DeleteTranscriptionJob(jobName string) error

DeleteTranscriptionJob removes a transcription job by name.

func (*InMemoryBackend) DeleteVocabulary

func (b *InMemoryBackend) DeleteVocabulary(vocabularyName string) error

DeleteVocabulary removes a custom vocabulary by name.

func (*InMemoryBackend) DeleteVocabularyFilter

func (b *InMemoryBackend) DeleteVocabularyFilter(vocabularyFilterName string) error

DeleteVocabularyFilter removes a vocabulary filter by name.

func (*InMemoryBackend) DescribeLanguageModel

func (b *InMemoryBackend) DescribeLanguageModel(modelName string) (*LanguageModel, error)

DescribeLanguageModel returns a language model by name.

func (*InMemoryBackend) GetCallAnalyticsCategory

func (b *InMemoryBackend) GetCallAnalyticsCategory(
	categoryName string,
) (*CallAnalyticsCategory, error)

GetCallAnalyticsCategory returns a Call Analytics category by name.

func (*InMemoryBackend) GetCallAnalyticsJob

func (b *InMemoryBackend) GetCallAnalyticsJob(jobName string) (*CallAnalyticsJob, error)

GetCallAnalyticsJob returns a Call Analytics job by name.

func (*InMemoryBackend) GetMedicalScribeJob

func (b *InMemoryBackend) GetMedicalScribeJob(jobName string) (*MedicalScribeJob, error)

GetMedicalScribeJob returns a Medical Scribe job by name.

func (*InMemoryBackend) GetMedicalTranscriptionJob

func (b *InMemoryBackend) GetMedicalTranscriptionJob(
	jobName string,
) (*MedicalTranscriptionJob, error)

GetMedicalTranscriptionJob returns a Medical Transcription job by name.

func (*InMemoryBackend) GetMedicalVocabulary

func (b *InMemoryBackend) GetMedicalVocabulary(vocabularyName string) (*MedicalVocabulary, error)

GetMedicalVocabulary returns a medical vocabulary by name. A missing vocabulary reports ErrVocabularyNotFound (400), not NotFoundException (404): the provider's delete waiter only treats BadRequestException as "gone" (gopherstack-h8cej).

func (*InMemoryBackend) GetTranscriptionJob

func (b *InMemoryBackend) GetTranscriptionJob(jobName string) (*TranscriptionJob, error)

GetTranscriptionJob returns a transcription job by name.

func (*InMemoryBackend) GetVocabulary

func (b *InMemoryBackend) GetVocabulary(vocabularyName string) (*Vocabulary, error)

GetVocabulary returns a custom vocabulary by name.

func (*InMemoryBackend) GetVocabularyFilter

func (b *InMemoryBackend) GetVocabularyFilter(
	vocabularyFilterName string,
) (*VocabularyFilter, error)

GetVocabularyFilter returns a custom vocabulary filter by name.

func (*InMemoryBackend) InventoryResources

func (b *InMemoryBackend) InventoryResources() []TaggedEntry

InventoryResources lists every job, vocabulary, vocabulary filter, language model and call analytics category plus every tagged ARN of the tag store.

func (*InMemoryBackend) ListCallAnalyticsCategories

func (b *InMemoryBackend) ListCallAnalyticsCategories(
	nextToken string, maxResults int32,
) ([]CallAnalyticsCategory, string)

ListCallAnalyticsCategories returns all Call Analytics categories with pagination.

func (*InMemoryBackend) ListCallAnalyticsJobs

func (b *InMemoryBackend) ListCallAnalyticsJobs(
	statusFilter, nameContains, nextToken string, maxResults int32,
) ([]CallAnalyticsJob, string)

ListCallAnalyticsJobs returns Call Analytics jobs with optional status filter, name substring filter, and pagination.

func (*InMemoryBackend) ListLanguageModels

func (b *InMemoryBackend) ListLanguageModels(
	statusFilter, nameContains, nextToken string, maxResults int32,
) ([]LanguageModel, string)

ListLanguageModels returns language models with optional status filter, name substring filter, and pagination.

func (*InMemoryBackend) ListMedicalScribeJobs

func (b *InMemoryBackend) ListMedicalScribeJobs(
	statusFilter, nameContains, nextToken string, maxResults int32,
) ([]MedicalScribeJob, string)

ListMedicalScribeJobs returns Medical Scribe jobs with optional status filter, name substring filter, and pagination.

func (*InMemoryBackend) ListMedicalTranscriptionJobs

func (b *InMemoryBackend) ListMedicalTranscriptionJobs(
	statusFilter, nameContains, nextToken string, maxResults int32,
) ([]MedicalTranscriptionJob, string)

ListMedicalTranscriptionJobs returns Medical Transcription jobs with optional status filter, name substring filter, and pagination.

func (*InMemoryBackend) ListMedicalVocabularies

func (b *InMemoryBackend) ListMedicalVocabularies(
	stateFilter, nameContains, nextToken string, maxResults int32,
) ([]MedicalVocabulary, string)

ListMedicalVocabularies returns medical vocabularies with optional state filter, name substring filter, and pagination.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)

ListTagsForResource returns all tags for a resource identified by ARN.

func (*InMemoryBackend) ListTranscriptionJobs

func (b *InMemoryBackend) ListTranscriptionJobs(
	statusFilter, nameContains, nextToken string, maxResults int32,
) ([]TranscriptionJob, string)

ListTranscriptionJobs returns transcription jobs, optionally filtered by status and name substring, with pagination.

func (*InMemoryBackend) ListVocabularies

func (b *InMemoryBackend) ListVocabularies(
	stateFilter, nameContains, nextToken string, maxResults int32,
) ([]Vocabulary, string)

ListVocabularies returns custom vocabularies with optional state filter, name substring filter, and pagination.

func (*InMemoryBackend) ListVocabularyFilters

func (b *InMemoryBackend) ListVocabularyFilters(
	nameContains, nextToken string, maxResults int32,
) ([]VocabularyFilter, string)

ListVocabularyFilters returns vocabulary filters with optional name substring filter and pagination.

func (*InMemoryBackend) ManagedOutput

func (b *InMemoryBackend) ManagedOutput(kind, name, token, file string) ([]byte, bool)

ManagedOutput returns a service-managed output file for the fetch URL.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) SetAppConfig

func (b *InMemoryBackend) SetAppConfig(cfg any)

SetAppConfig records the service.AppContext.Config for lazy S3 lookup.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(now func() time.Time)

SetClock replaces the time source used for job lifecycles.

func (*InMemoryBackend) SetEngine

func (b *InMemoryBackend) SetEngine(e Engine)

SetEngine installs a speech-to-text engine; nil restores the default of emitting empty transcripts.

func (*InMemoryBackend) SetLifecycleDelay

func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)

SetLifecycleDelay sets how long new jobs report IN_PROGRESS, vocabularies PENDING and language models IN_PROGRESS before settling. Zero (the default) settles instantly.

func (*InMemoryBackend) SetMediaReader

func (b *InMemoryBackend) SetMediaReader(r MediaReader)

SetMediaReader overrides where job media is read from.

func (*InMemoryBackend) SetS3Writer

func (b *InMemoryBackend) SetS3Writer(w S3Writer)

SetS3Writer overrides the S3 destination for job output.

func (*InMemoryBackend) Shutdown

func (b *InMemoryBackend) Shutdown(ctx context.Context)

Shutdown cancels in-flight recognition runs and waits for them.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartCallAnalyticsJob

func (b *InMemoryBackend) StartCallAnalyticsJob(input *CallAnalyticsJob) (*CallAnalyticsJob, error)

StartCallAnalyticsJob creates a new Call Analytics job.

func (*InMemoryBackend) StartMedicalScribeJob

func (b *InMemoryBackend) StartMedicalScribeJob(input *MedicalScribeJob) (*MedicalScribeJob, error)

StartMedicalScribeJob creates a new Medical Scribe job.

func (*InMemoryBackend) StartMedicalTranscriptionJob

func (b *InMemoryBackend) StartMedicalTranscriptionJob(
	input *MedicalTranscriptionJob,
) (*MedicalTranscriptionJob, error)

StartMedicalTranscriptionJob creates a new Medical Transcription job.

func (*InMemoryBackend) StartTranscriptionJob

func (b *InMemoryBackend) StartTranscriptionJob(input *TranscriptionJob) (*TranscriptionJob, error)

StartTranscriptionJob creates a transcription job; media is read and output written as the job settles.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, tags map[string]string) error

TagResource adds or updates tags on a resource identified by ARN.

func (*InMemoryBackend) TaggedResources added in v1.3.1

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources lists every tag-store ARN that carries at least one tag.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error

UntagResource removes specific tag keys from a resource identified by ARN.

func (*InMemoryBackend) UpdateCallAnalyticsCategory

func (b *InMemoryBackend) UpdateCallAnalyticsCategory(input *CallAnalyticsCategory) (*CallAnalyticsCategory, error)

UpdateCallAnalyticsCategory updates an existing Call Analytics category.

func (*InMemoryBackend) UpdateLanguageModel

func (b *InMemoryBackend) UpdateLanguageModel(
	modelName, dataAccessRoleArn string, enc *EncryptionConfig,
) (*LanguageModel, error)

UpdateLanguageModel changes the data access role and/or encryption configuration of a model that is not IN_PROGRESS.

func (*InMemoryBackend) UpdateMedicalVocabulary

func (b *InMemoryBackend) UpdateMedicalVocabulary(
	vocabularyName, languageCode, vocabularyFileURI string,
) (*MedicalVocabulary, error)

UpdateMedicalVocabulary updates an existing medical vocabulary.

func (*InMemoryBackend) UpdateVocabulary

func (b *InMemoryBackend) UpdateVocabulary(
	input *Vocabulary,
) (*Vocabulary, error)

UpdateVocabulary updates an existing custom vocabulary.

func (*InMemoryBackend) UpdateVocabularyFilter

func (b *InMemoryBackend) UpdateVocabularyFilter(
	input *VocabularyFilter,
) (*VocabularyFilter, error)

UpdateVocabularyFilter updates an existing vocabulary filter.

type InputDataConfig

type InputDataConfig struct {
	S3Uri             string `json:"S3Uri"`
	TuningDataS3Uri   string `json:"TuningDataS3Uri,omitempty"`
	DataAccessRoleArn string `json:"DataAccessRoleArn"`
}

InputDataConfig holds the S3 input configuration for custom language models.

type InterruptionFilter

type InterruptionFilter struct {
	AbsoluteTimeRange *AbsoluteTimeRange `json:"AbsoluteTimeRange,omitempty"`
	RelativeTimeRange *RelativeTimeRange `json:"RelativeTimeRange,omitempty"`
	ParticipantRole   string             `json:"ParticipantRole,omitempty"`
	Threshold         int64              `json:"Threshold,omitempty"`
	Negate            bool               `json:"Negate,omitempty"`
}

InterruptionFilter matches interruptions by a participant.

type JobExecutionSettings

type JobExecutionSettings struct {
	DataAccessRoleArn      string `json:"DataAccessRoleArn,omitempty"`
	AllowDeferredExecution bool   `json:"AllowDeferredExecution,omitempty"`
}

JobExecutionSettings controls deferred execution behavior.

type LanguageCodeItem

type LanguageCodeItem struct {
	LanguageCode      string  `json:"LanguageCode"`
	DurationInSeconds float32 `json:"DurationInSeconds"`
}

LanguageCodeItem represents an identified language with a score.

type LanguageIDSettings

type LanguageIDSettings struct {
	VocabularyName       string `json:"VocabularyName,omitempty"`
	VocabularyFilterName string `json:"VocabularyFilterName,omitempty"`
	LanguageModelName    string `json:"LanguageModelName,omitempty"`
}

LanguageIDSettings holds per-language-code identification settings.

type LanguageModel

type LanguageModel struct {
	CreateTime          time.Time         `json:"createTime"`
	LastModifiedTime    time.Time         `json:"lastModifiedTime"`
	InputDataConfig     *InputDataConfig  `json:"inputDataConfig,omitempty"`
	Encryption          *EncryptionConfig `json:"encryptionConfiguration,omitempty"`
	Tags                map[string]string `json:"tags,omitempty"`
	ModelName           string            `json:"modelName"`
	BaseModelName       string            `json:"baseModelName"`
	LanguageCode        string            `json:"languageCode"`
	ModelStatus         string            `json:"modelStatus"`
	FailureReason       string            `json:"failureReason,omitempty"`
	UpgradeAvailability bool              `json:"upgradeAvailability,omitempty"`
}

LanguageModel represents a custom Amazon Transcribe language model.

type LimitedMediaReader

type LimitedMediaReader interface {
	GetObjectLimit(ctx context.Context, bucket, key string, limit int64) ([]byte, error)
}

LimitedMediaReader is a MediaReader that can stop reading an object after limit bytes.

type Media

type Media struct {
	MediaFileURI         string `json:"MediaFileUri,omitempty"`
	RedactedMediaFileURI string `json:"RedactedMediaFileUri,omitempty"`
}

Media holds the media location for a job.

type MediaReader

type MediaReader interface {
	GetObject(ctx context.Context, bucket, key string) ([]byte, error)
}

MediaReader fetches a job's input media from S3.

type MedicalScribeChannelDefinition

type MedicalScribeChannelDefinition struct {
	ParticipantRole string `json:"ParticipantRole"`
	ChannelID       int32  `json:"ChannelId"`
}

MedicalScribeChannelDefinition defines a channel in a medical scribe job.

type MedicalScribeJob

type MedicalScribeJob struct {
	StartTime              time.Time                        `json:"startTime"`
	CompletionTime         time.Time                        `json:"completionTime"`
	CreationTime           time.Time                        `json:"creationTime"`
	Tags                   map[string]string                `json:"tags,omitempty"`
	Settings               *MedicalScribeSettings           `json:"settings,omitempty"`
	Media                  Media                            `json:"media"`
	LanguageCode           string                           `json:"languageCode,omitempty"`
	DataAccessRoleArn      string                           `json:"dataAccessRoleArn,omitempty"`
	OutputBucketName       string                           `json:"outputBucketName,omitempty"`
	FailureReason          string                           `json:"failureReason,omitempty"`
	MedicalScribeJobStatus string                           `json:"medicalScribeJobStatus"`
	MedicalScribeJobName   string                           `json:"medicalScribeJobName"`
	ChannelDefinitions     []MedicalScribeChannelDefinition `json:"channelDefinitions,omitempty"`
	ContextProvided        bool                             `json:"medicalScribeContextProvided,omitempty"`
}

MedicalScribeJob represents an Amazon Transcribe Medical Scribe job.

type MedicalScribeSettings

type MedicalScribeSettings struct {
	ClinicalNoteGenerationSettings *ClinicalNoteGenerationSettings `json:"ClinicalNoteGenerationSettings,omitempty"`
	VocabularyName                 string                          `json:"VocabularyName,omitempty"`
	VocabularyFilterName           string                          `json:"VocabularyFilterName,omitempty"`
	VocabularyFilterMethod         string                          `json:"VocabularyFilterMethod,omitempty"`
	MaxSpeakerLabels               int32                           `json:"MaxSpeakerLabels,omitempty"`
	ShowSpeakerLabels              bool                            `json:"ShowSpeakerLabels,omitempty"`
	ChannelIdentification          bool                            `json:"ChannelIdentification,omitempty"`
}

MedicalScribeSettings holds settings for a Medical Scribe job.

type MedicalTranscriptionJob

type MedicalTranscriptionJob struct {
	CreationTime                     time.Time                     `json:"creationTime"`
	StartTime                        time.Time                     `json:"startTime"`
	CompletionTime                   time.Time                     `json:"completionTime"`
	Tags                             map[string]string             `json:"tags,omitempty"`
	Settings                         *MedicalTranscriptionSettings `json:"settings,omitempty"`
	Media                            Media                         `json:"media"`
	Type                             string                        `json:"type,omitempty"`
	Specialty                        string                        `json:"specialty,omitempty"`
	LanguageCode                     string                        `json:"languageCode"`
	MediaFormat                      string                        `json:"mediaFormat,omitempty"`
	FailureReason                    string                        `json:"failureReason,omitempty"`
	OutputBucketName                 string                        `json:"outputBucketName,omitempty"`
	OutputKey                        string                        `json:"outputKey,omitempty"`
	TranscriptionJobStatus           string                        `json:"transcriptionJobStatus"`
	MedicalContentIdentificationType string                        `json:"medicalContentIdentificationType,omitempty"`
	MedicalTranscriptionJobName      string                        `json:"medicalTranscriptionJobName"`
	ManagedOutputs                   map[string][]byte             `json:"managedOutputs,omitempty"`
	TranscriptFileURI                string                        `json:"transcriptFileUri,omitempty"`
	ManagedToken                     string                        `json:"managedToken,omitempty"`
	TranscriptJSON                   []byte                        `json:"transcriptJson,omitempty"`
	MediaSampleRateHertz             int32                         `json:"mediaSampleRateHertz,omitempty"`
}

MedicalTranscriptionJob represents an Amazon Transcribe Medical transcription job.

type MedicalTranscriptionSettings

type MedicalTranscriptionSettings struct {
	VocabularyName        string `json:"VocabularyName,omitempty"`
	MaxSpeakerLabels      int32  `json:"MaxSpeakerLabels,omitempty"`
	MaxAlternatives       int32  `json:"MaxAlternatives,omitempty"`
	ShowSpeakerLabels     bool   `json:"ShowSpeakerLabels,omitempty"`
	ChannelIdentification bool   `json:"ChannelIdentification,omitempty"`
	ShowAlternatives      bool   `json:"ShowAlternatives,omitempty"`
}

MedicalTranscriptionSettings holds settings specific to medical transcription.

type MedicalVocabulary

type MedicalVocabulary struct {
	LastModifiedTime  time.Time         `json:"lastModifiedTime"`
	Tags              map[string]string `json:"tags,omitempty"`
	VocabularyName    string            `json:"vocabularyName"`
	LanguageCode      string            `json:"languageCode"`
	VocabularyState   string            `json:"vocabularyState"`
	VocabularyFileURI string            `json:"vocabularyFileUri"`
	FailureReason     string            `json:"failureReason,omitempty"`
}

MedicalVocabulary represents an Amazon Transcribe Medical custom vocabulary.

type ModelSettings

type ModelSettings struct {
	LanguageModelName string `json:"LanguageModelName,omitempty"`
}

ModelSettings holds the language model settings for a transcription job.

type NonTalkTimeFilter

type NonTalkTimeFilter struct {
	AbsoluteTimeRange *AbsoluteTimeRange `json:"AbsoluteTimeRange,omitempty"`
	RelativeTimeRange *RelativeTimeRange `json:"RelativeTimeRange,omitempty"`
	ParticipantRole   string             `json:"ParticipantRole,omitempty"`
	Threshold         int64              `json:"Threshold,omitempty"`
	Negate            bool               `json:"Negate,omitempty"`
}

NonTalkTimeFilter matches segments with no speech.

ParticipantRole is not a real member of AWS's NonTalkTimeFilter (unlike its three siblings below) - kept for backward compatibility, but unreachable by a real client since the real request/response type has no such field.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon Transcribe.

func (*Provider) Init

Init initializes the Transcribe service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RelativeTimeRange added in v1.3.1

type RelativeTimeRange struct {
	EndPercentage   *int32 `json:"EndPercentage,omitempty"`
	First           *int32 `json:"First,omitempty"`
	Last            *int32 `json:"Last,omitempty"`
	StartPercentage *int32 `json:"StartPercentage,omitempty"`
}

RelativeTimeRange specifies a time range as a percentage of the media duration within a call analytics rule filter.

type S3Writer

type S3Writer interface {
	PutObject(ctx context.Context, bucket, key string, data []byte) error
}

S3Writer stores a finished job's output object.

type SentimentFilter

type SentimentFilter struct {
	AbsoluteTimeRange *AbsoluteTimeRange `json:"AbsoluteTimeRange,omitempty"`
	RelativeTimeRange *RelativeTimeRange `json:"RelativeTimeRange,omitempty"`
	ParticipantRole   string             `json:"ParticipantRole,omitempty"`
	Sentiments        []string           `json:"Sentiments"`
	Negate            bool               `json:"Negate,omitempty"`
}

SentimentFilter matches sentiment in the transcript.

type Settings

type Settings struct {
	Engine string `` //nolint:lll // Kong struct tag makes this line long
	/* 203-byte string literal not displayed */
	EngineImage string `` //nolint:lll // Kong struct tag makes this line long
	/* 143-byte string literal not displayed */
	ModelDir string `` //nolint:lll // Kong struct tag makes this line long
	/* 150-byte string literal not displayed */
}

Settings holds service-level configuration for the Transcribe backend.

type StorageBackend

type StorageBackend interface {
	// Transcription jobs
	StartTranscriptionJob(input *TranscriptionJob) (*TranscriptionJob, error)
	GetTranscriptionJob(jobName string) (*TranscriptionJob, error)
	ListTranscriptionJobs(statusFilter, nameContains, nextToken string, maxResults int32) ([]TranscriptionJob, string)
	DeleteTranscriptionJob(jobName string) error

	// Call Analytics categories
	CreateCallAnalyticsCategory(cat *CallAnalyticsCategory) (*CallAnalyticsCategory, error)
	DeleteCallAnalyticsCategory(categoryName string) error

	// Language models
	CreateLanguageModel(model *LanguageModel) (*LanguageModel, error)
	DeleteLanguageModel(modelName string) error
	UpdateLanguageModel(modelName, dataAccessRoleArn string, enc *EncryptionConfig) (*LanguageModel, error)

	// Vocabularies
	CreateMedicalVocabulary(
		vocabularyName, languageCode, vocabularyFileURI string, tags map[string]string,
	) (*MedicalVocabulary, error)
	CreateVocabulary(vocab *Vocabulary) (*Vocabulary, error)
	CreateVocabularyFilter(vf *VocabularyFilter) (*VocabularyFilter, error)

	// Call Analytics jobs
	StartCallAnalyticsJob(job *CallAnalyticsJob) (*CallAnalyticsJob, error)
	GetCallAnalyticsJob(jobName string) (*CallAnalyticsJob, error)
	ListCallAnalyticsJobs(statusFilter, nameContains, nextToken string, maxResults int32) ([]CallAnalyticsJob, string)
	DeleteCallAnalyticsJob(jobName string) error

	// Call Analytics categories (Get/Update/List)
	GetCallAnalyticsCategory(categoryName string) (*CallAnalyticsCategory, error)
	UpdateCallAnalyticsCategory(cat *CallAnalyticsCategory) (*CallAnalyticsCategory, error)
	ListCallAnalyticsCategories(nextToken string, maxResults int32) ([]CallAnalyticsCategory, string)

	// Vocabulary CRUD
	GetVocabulary(vocabularyName string) (*Vocabulary, error)
	UpdateVocabulary(vocab *Vocabulary) (*Vocabulary, error)
	DeleteVocabulary(vocabularyName string) error
	ListVocabularies(stateFilter, nameContains, nextToken string, maxResults int32) ([]Vocabulary, string)

	// Vocabulary filter CRUD
	GetVocabularyFilter(vocabularyFilterName string) (*VocabularyFilter, error)
	UpdateVocabularyFilter(vf *VocabularyFilter) (*VocabularyFilter, error)
	DeleteVocabularyFilter(vocabularyFilterName string) error
	ListVocabularyFilters(nameContains, nextToken string, maxResults int32) ([]VocabularyFilter, string)

	// Medical vocabulary CRUD
	GetMedicalVocabulary(vocabularyName string) (*MedicalVocabulary, error)
	UpdateMedicalVocabulary(vocabularyName, languageCode, vocabularyFileURI string) (*MedicalVocabulary, error)
	DeleteMedicalVocabulary(vocabularyName string) error
	ListMedicalVocabularies(
		stateFilter, nameContains, nextToken string, maxResults int32,
	) ([]MedicalVocabulary, string)

	// Medical Scribe jobs
	StartMedicalScribeJob(job *MedicalScribeJob) (*MedicalScribeJob, error)
	GetMedicalScribeJob(jobName string) (*MedicalScribeJob, error)
	ListMedicalScribeJobs(
		statusFilter, nameContains, nextToken string, maxResults int32,
	) ([]MedicalScribeJob, string)
	DeleteMedicalScribeJob(jobName string) error

	// Medical Transcription jobs
	StartMedicalTranscriptionJob(job *MedicalTranscriptionJob) (*MedicalTranscriptionJob, error)
	GetMedicalTranscriptionJob(jobName string) (*MedicalTranscriptionJob, error)
	ListMedicalTranscriptionJobs(
		statusFilter, nameContains, nextToken string, maxResults int32,
	) ([]MedicalTranscriptionJob, string)
	DeleteMedicalTranscriptionJob(jobName string) error

	// Language model CRUD
	DescribeLanguageModel(modelName string) (*LanguageModel, error)
	ListLanguageModels(statusFilter, nameContains, nextToken string, maxResults int32) ([]LanguageModel, string)

	// Tags
	TagResource(resourceArn string, tags map[string]string) error
	UntagResource(resourceArn string, tagKeys []string) error
	ListTagsForResource(resourceArn string) (map[string]string, error)

	// Lifecycle
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend defines the interface for Transcribe backend implementations. All mutating methods must be safe for concurrent use.

type SubtitlesInput

type SubtitlesInput struct {
	Formats          []string `json:"Formats"`
	OutputStartIndex int32    `json:"OutputStartIndex,omitempty"`
}

SubtitlesInput represents the subtitle generation settings.

type SubtitlesOutput

type SubtitlesOutput struct {
	Formats          []string `json:"Formats,omitempty"`
	SubtitleFileURIs []string `json:"SubtitleFileUris,omitempty"`
	OutputStartIndex int32    `json:"OutputStartIndex,omitempty"`
}

SubtitlesOutput represents the subtitle output returned by Get operations.

type SummarizationSettings

type SummarizationSettings struct {
	GenerateAbstractiveSummary bool `json:"GenerateAbstractiveSummary"`
}

SummarizationSettings controls generative call summarization.

type TaggedEntry added in v1.3.1

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tags.

type ToxicityDetectionSettings

type ToxicityDetectionSettings struct {
	ToxicityCategories []string `json:"ToxicityCategories"`
}

ToxicityDetectionSettings represents a toxicity detection entry.

type TranscriptFilter

type TranscriptFilter struct {
	AbsoluteTimeRange    *AbsoluteTimeRange `json:"AbsoluteTimeRange,omitempty"`
	RelativeTimeRange    *RelativeTimeRange `json:"RelativeTimeRange,omitempty"`
	TranscriptFilterType string             `json:"TranscriptFilterType"`
	ParticipantRole      string             `json:"ParticipantRole,omitempty"`
	Targets              []string           `json:"Targets"`
	Negate               bool               `json:"Negate,omitempty"`
}

TranscriptFilter matches specific phrases in the transcript.

type TranscriptionJob

type TranscriptionJob struct {
	StartTime                 time.Time                     `json:"startTime"`
	CompletionTime            time.Time                     `json:"completionTime"`
	CreationTime              time.Time                     `json:"creationTime"`
	Tags                      map[string]string             `json:"tags,omitempty"`
	Subtitles                 *SubtitlesOutput              `json:"subtitles,omitempty"`
	ContentRedaction          *ContentRedaction             `json:"contentRedaction,omitempty"`
	ModelSettings             *ModelSettings                `json:"modelSettings,omitempty"`
	JobExecutionSettings      *JobExecutionSettings         `json:"jobExecutionSettings,omitempty"`
	Settings                  *TranscriptionSettings        `json:"settings,omitempty"`
	Media                     Media                         `json:"media"`
	LanguageCode              string                        `json:"languageCode"`
	JobStatus                 string                        `json:"jobStatus"`
	MediaFormat               string                        `json:"mediaFormat,omitempty"`
	OutputBucketName          string                        `json:"outputBucketName,omitempty"`
	OutputKey                 string                        `json:"outputKey,omitempty"`
	OutputEncryptionKMSKeyID  string                        `json:"outputEncryptionKMSKeyId,omitempty"`
	JobName                   string                        `json:"jobName"`
	FailureReason             string                        `json:"failureReason,omitempty"`
	LanguageOptions           []string                      `json:"languageOptions,omitempty"`
	ToxicityDetection         []ToxicityDetectionSettings   `json:"toxicityDetection,omitempty"`
	LanguageCodes             []LanguageCodeItem            `json:"languageCodes,omitempty"`
	LanguageIDSettings        map[string]LanguageIDSettings `json:"languageIdSettings,omitempty"`
	ManagedOutputs            map[string][]byte             `json:"managedOutputs,omitempty"`
	TranscriptFileURI         string                        `json:"transcriptFileUri,omitempty"`
	RedactedTranscriptURI     string                        `json:"redactedTranscriptFileUri,omitempty"`
	ManagedToken              string                        `json:"managedToken,omitempty"`
	TranscriptJSON            []byte                        `json:"transcriptJson,omitempty"`
	MediaSampleRateHertz      int32                         `json:"mediaSampleRateHertz,omitempty"`
	IdentifiedLanguageScore   float32                       `json:"identifiedLanguageScore,omitempty"`
	IdentifyLanguage          bool                          `json:"identifyLanguage,omitempty"`
	IdentifyMultipleLanguages bool                          `json:"identifyMultipleLanguages,omitempty"`
}

TranscriptionJob represents an Amazon Transcribe transcription job.

type TranscriptionSettings

type TranscriptionSettings struct {
	VocabularyName         string `json:"VocabularyName,omitempty"`
	VocabularyFilterName   string `json:"VocabularyFilterName,omitempty"`
	VocabularyFilterMethod string `json:"VocabularyFilterMethod,omitempty"`
	MaxSpeakerLabels       int32  `json:"MaxSpeakerLabels,omitempty"`
	MaxAlternatives        int32  `json:"MaxAlternatives,omitempty"`
	ShowSpeakerLabels      bool   `json:"ShowSpeakerLabels,omitempty"`
	ChannelIdentification  bool   `json:"ChannelIdentification,omitempty"`
	ShowAlternatives       bool   `json:"ShowAlternatives,omitempty"`
}

TranscriptionSettings represents the Settings field of a transcription job.

type Vocabulary

type Vocabulary struct {
	LastModifiedTime  time.Time         `json:"lastModifiedTime"`
	Tags              map[string]string `json:"tags,omitempty"`
	VocabularyName    string            `json:"vocabularyName"`
	LanguageCode      string            `json:"languageCode"`
	VocabularyState   string            `json:"vocabularyState"`
	VocabularyFileURI string            `json:"vocabularyFileUri,omitempty"`
	FailureReason     string            `json:"failureReason,omitempty"`
	Phrases           []string          `json:"phrases,omitempty"`
}

Vocabulary represents an Amazon Transcribe custom vocabulary.

type VocabularyFilter

type VocabularyFilter struct {
	LastModifiedTime        time.Time         `json:"lastModifiedTime"`
	Tags                    map[string]string `json:"tags,omitempty"`
	VocabularyFilterName    string            `json:"vocabularyFilterName"`
	LanguageCode            string            `json:"languageCode"`
	VocabularyFilterFileURI string            `json:"vocabularyFilterFileUri,omitempty"`
	Words                   []string          `json:"words,omitempty"`
}

VocabularyFilter represents an Amazon Transcribe custom vocabulary filter.

type VoskConfig

type VoskConfig struct {
	Runtime      EngineRuntime
	HTTP         *http.Client
	Models       map[string]VoskModel
	Image        string
	ModelDir     string
	ModelBaseURL string
}

VoskConfig configures a VoskEngine.

type VoskEngine

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

VoskEngine runs the offline Vosk recognizer inside a container, one warm container per language model.

func NewVoskEngine

func NewVoskEngine(cfg VoskConfig) *VoskEngine

NewVoskEngine builds an engine; containers and models are created on first use.

func (*VoskEngine) Close

func (e *VoskEngine) Close(ctx context.Context)

Close removes the engine's containers and scratch directory.

func (*VoskEngine) Recognize

func (e *VoskEngine) Recognize(ctx context.Context, language string, sampleRate int, pcm []byte) ([]Word, error)

Recognize implements Engine.

func (*VoskEngine) SupportsLanguage

func (e *VoskEngine) SupportsLanguage(code string) bool

SupportsLanguage implements Engine.

type VoskModel

type VoskModel struct {
	Name   string
	SHA256 string
}

VoskModel is a pinned small Vosk model archive.

type Word

type Word struct {
	Text       string
	Start      float64
	End        float64
	Confidence float64
	Filtered   bool
}

Word is one recognised word with timings in seconds.

Jump to

Keyboard shortcuts

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