speechrecognition

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package speechrecognition turns speech into text, with the phone's own recognizer. For a whole assistant turn sent to your server, use audio.

nimbus native plugin add speech-recognition

ok, err := speechrecognition.Request(ctx)
text, err := speechrecognition.Listen(ctx, speechrecognition.Options{
	Language: "hi-IN", OnPartial: setDraft})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(ctx context.Context, o Options) (string, error)

Listen hears one phrase and returns its text. It ends when they stop speaking; a cancelled ctx stops it. Nothing heard is "", not an error.

func Request

func Request(ctx context.Context) (bool, error)

Request asks for the microphone and speech recognition, once.

Types

type Options

type Options struct {
	Language  string            // BCP 47, such as "hi-IN"; empty for the phone's own
	OnPartial func(text string) // what it has so far, as they speak
}

Options shapes a listen.

Jump to

Keyboard shortcuts

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