stt_service

package
v0.0.0-...-b4d36e0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatsService_GetStats_FullMethodName = "/vosk.stt.v1.StatsService/GetStats"
)
View Source
const (
	SttService_StreamingRecognize_FullMethodName = "/vosk.stt.v1.SttService/StreamingRecognize"
)

Variables

View Source
var (
	RecognitionSpec_AudioEncoding_name = map[int32]string{
		0: "AUDIO_ENCODING_UNSPECIFIED",
		1: "LINEAR16_PCM",
	}
	RecognitionSpec_AudioEncoding_value = map[string]int32{
		"AUDIO_ENCODING_UNSPECIFIED": 0,
		"LINEAR16_PCM":               1,
	}
)

Enum value maps for RecognitionSpec_AudioEncoding.

View Source
var File_stt_service_service_proto protoreflect.FileDescriptor
View Source
var StatsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vosk.stt.v1.StatsService",
	HandlerType: (*StatsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetStats",
			Handler:    _StatsService_GetStats_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "stt_service/service.proto",
}

StatsService_ServiceDesc is the grpc.ServiceDesc for StatsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var SttService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vosk.stt.v1.SttService",
	HandlerType: (*SttServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamingRecognize",
			Handler:       _SttService_StreamingRecognize_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "stt_service/service.proto",
}

SttService_ServiceDesc is the grpc.ServiceDesc for SttService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterStatsServiceServer

func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer)

func RegisterSttServiceServer

func RegisterSttServiceServer(s grpc.ServiceRegistrar, srv SttServiceServer)

Types

type RecognitionConfig

type RecognitionConfig struct {
	Specification *RecognitionSpec `protobuf:"bytes,1,opt,name=specification,proto3" json:"specification,omitempty"`
	// contains filtered or unexported fields
}

func (*RecognitionConfig) Descriptor deprecated

func (*RecognitionConfig) Descriptor() ([]byte, []int)

Deprecated: Use RecognitionConfig.ProtoReflect.Descriptor instead.

func (*RecognitionConfig) GetSpecification

func (x *RecognitionConfig) GetSpecification() *RecognitionSpec

func (*RecognitionConfig) ProtoMessage

func (*RecognitionConfig) ProtoMessage()

func (*RecognitionConfig) ProtoReflect

func (x *RecognitionConfig) ProtoReflect() protoreflect.Message

func (*RecognitionConfig) Reset

func (x *RecognitionConfig) Reset()

func (*RecognitionConfig) String

func (x *RecognitionConfig) String() string

type RecognitionSpec

type RecognitionSpec struct {
	AudioEncoding RecognitionSpec_AudioEncoding `` /* 148-byte string literal not displayed */
	// 8000, 16000, 48000 only for pcm
	SampleRateHertz int64 `protobuf:"varint,2,opt,name=sample_rate_hertz,json=sampleRateHertz,proto3" json:"sample_rate_hertz,omitempty"`
	// code in BCP-47
	LanguageCode    string `protobuf:"bytes,3,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
	ProfanityFilter bool   `protobuf:"varint,4,opt,name=profanity_filter,json=profanityFilter,proto3" json:"profanity_filter,omitempty"`
	Model           string `protobuf:"bytes,5,opt,name=model,proto3" json:"model,omitempty"`
	// If set true, tentative hypotheses may be returned as they become available (final=false flag)
	// If false or omitted, only final=true result(s) are returned.
	// Makes sense only for StreamingRecognize requests.
	PartialResults  bool `protobuf:"varint,7,opt,name=partial_results,json=partialResults,proto3" json:"partial_results,omitempty"`
	SingleUtterance bool `protobuf:"varint,8,opt,name=single_utterance,json=singleUtterance,proto3" json:"single_utterance,omitempty"`
	// This mark allows disable normalization text
	RawResults bool `protobuf:"varint,10,opt,name=raw_results,json=rawResults,proto3" json:"raw_results,omitempty"`
	// Maximum number of recognition hypotheses to be returned.
	// Specifically, the maximum number of `SpeechRecognitionAlternative` messages
	// within each `SpeechRecognitionResult`.
	// The server may return fewer than `max_alternatives`.
	// Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
	// one. If omitted, will return a maximum of one.
	MaxAlternatives int32 `protobuf:"varint,11,opt,name=max_alternatives,json=maxAlternatives,proto3" json:"max_alternatives,omitempty"`
	// If `true`, the top result includes a list of words and
	// the start and end time offsets (timestamps) for those words. If
	// `false`, no word-level time offset information is returned. The default is
	// `false`.
	EnableWordTimeOffsets bool `` /* 130-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*RecognitionSpec) Descriptor deprecated

func (*RecognitionSpec) Descriptor() ([]byte, []int)

Deprecated: Use RecognitionSpec.ProtoReflect.Descriptor instead.

func (*RecognitionSpec) GetAudioEncoding

func (x *RecognitionSpec) GetAudioEncoding() RecognitionSpec_AudioEncoding

func (*RecognitionSpec) GetEnableWordTimeOffsets

func (x *RecognitionSpec) GetEnableWordTimeOffsets() bool

func (*RecognitionSpec) GetLanguageCode

func (x *RecognitionSpec) GetLanguageCode() string

func (*RecognitionSpec) GetMaxAlternatives

func (x *RecognitionSpec) GetMaxAlternatives() int32

func (*RecognitionSpec) GetModel

func (x *RecognitionSpec) GetModel() string

func (*RecognitionSpec) GetPartialResults

func (x *RecognitionSpec) GetPartialResults() bool

func (*RecognitionSpec) GetProfanityFilter

func (x *RecognitionSpec) GetProfanityFilter() bool

func (*RecognitionSpec) GetRawResults

func (x *RecognitionSpec) GetRawResults() bool

func (*RecognitionSpec) GetSampleRateHertz

func (x *RecognitionSpec) GetSampleRateHertz() int64

func (*RecognitionSpec) GetSingleUtterance

func (x *RecognitionSpec) GetSingleUtterance() bool

func (*RecognitionSpec) ProtoMessage

func (*RecognitionSpec) ProtoMessage()

func (*RecognitionSpec) ProtoReflect

func (x *RecognitionSpec) ProtoReflect() protoreflect.Message

func (*RecognitionSpec) Reset

func (x *RecognitionSpec) Reset()

func (*RecognitionSpec) String

func (x *RecognitionSpec) String() string

type RecognitionSpec_AudioEncoding

type RecognitionSpec_AudioEncoding int32
const (
	RecognitionSpec_AUDIO_ENCODING_UNSPECIFIED RecognitionSpec_AudioEncoding = 0
	// 16-bit signed little-endian (Linear PCM)
	RecognitionSpec_LINEAR16_PCM RecognitionSpec_AudioEncoding = 1
)

func (RecognitionSpec_AudioEncoding) Descriptor

func (RecognitionSpec_AudioEncoding) Enum

func (RecognitionSpec_AudioEncoding) EnumDescriptor deprecated

func (RecognitionSpec_AudioEncoding) EnumDescriptor() ([]byte, []int)

Deprecated: Use RecognitionSpec_AudioEncoding.Descriptor instead.

func (RecognitionSpec_AudioEncoding) Number

func (RecognitionSpec_AudioEncoding) String

func (RecognitionSpec_AudioEncoding) Type

type SpeechRecognitionAlternative

type SpeechRecognitionAlternative struct {
	Text       string      `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Confidence float32     `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
	Words      []*WordInfo `protobuf:"bytes,3,rep,name=words,proto3" json:"words,omitempty"`
	// contains filtered or unexported fields
}

func (*SpeechRecognitionAlternative) Descriptor deprecated

func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int)

Deprecated: Use SpeechRecognitionAlternative.ProtoReflect.Descriptor instead.

func (*SpeechRecognitionAlternative) GetConfidence

func (x *SpeechRecognitionAlternative) GetConfidence() float32

func (*SpeechRecognitionAlternative) GetText

func (x *SpeechRecognitionAlternative) GetText() string

func (*SpeechRecognitionAlternative) GetWords

func (x *SpeechRecognitionAlternative) GetWords() []*WordInfo

func (*SpeechRecognitionAlternative) ProtoMessage

func (*SpeechRecognitionAlternative) ProtoMessage()

func (*SpeechRecognitionAlternative) ProtoReflect

func (*SpeechRecognitionAlternative) Reset

func (x *SpeechRecognitionAlternative) Reset()

func (*SpeechRecognitionAlternative) String

type SpeechRecognitionChunk

type SpeechRecognitionChunk struct {
	Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives,proto3" json:"alternatives,omitempty"`
	// This flag shows that the received chunk contains a part of the recognized text that won't be changed.
	Final bool `protobuf:"varint,2,opt,name=final,proto3" json:"final,omitempty"`
	// This flag shows that the received chunk is the end of an utterance.
	EndOfUtterance bool `protobuf:"varint,3,opt,name=end_of_utterance,json=endOfUtterance,proto3" json:"end_of_utterance,omitempty"`
	// contains filtered or unexported fields
}

func (*SpeechRecognitionChunk) Descriptor deprecated

func (*SpeechRecognitionChunk) Descriptor() ([]byte, []int)

Deprecated: Use SpeechRecognitionChunk.ProtoReflect.Descriptor instead.

func (*SpeechRecognitionChunk) GetAlternatives

func (x *SpeechRecognitionChunk) GetAlternatives() []*SpeechRecognitionAlternative

func (*SpeechRecognitionChunk) GetEndOfUtterance

func (x *SpeechRecognitionChunk) GetEndOfUtterance() bool

func (*SpeechRecognitionChunk) GetFinal

func (x *SpeechRecognitionChunk) GetFinal() bool

func (*SpeechRecognitionChunk) ProtoMessage

func (*SpeechRecognitionChunk) ProtoMessage()

func (*SpeechRecognitionChunk) ProtoReflect

func (x *SpeechRecognitionChunk) ProtoReflect() protoreflect.Message

func (*SpeechRecognitionChunk) Reset

func (x *SpeechRecognitionChunk) Reset()

func (*SpeechRecognitionChunk) String

func (x *SpeechRecognitionChunk) String() string

type StatsResponse

type StatsResponse struct {
	NStreams      int32   `protobuf:"varint,1,opt,name=n_streams,json=nStreams,proto3" json:"n_streams,omitempty"`
	NTotalStreams int32   `protobuf:"varint,2,opt,name=n_total_streams,json=nTotalStreams,proto3" json:"n_total_streams,omitempty"`
	MaxChunkRtf   float32 `protobuf:"fixed32,4,opt,name=max_chunk_rtf,json=maxChunkRtf,proto3" json:"max_chunk_rtf,omitempty"`
	MaxStreamRtf  float32 `protobuf:"fixed32,6,opt,name=max_stream_rtf,json=maxStreamRtf,proto3" json:"max_stream_rtf,omitempty"`
	// contains filtered or unexported fields
}

func (*StatsResponse) Descriptor deprecated

func (*StatsResponse) Descriptor() ([]byte, []int)

Deprecated: Use StatsResponse.ProtoReflect.Descriptor instead.

func (*StatsResponse) GetMaxChunkRtf

func (x *StatsResponse) GetMaxChunkRtf() float32

func (*StatsResponse) GetMaxStreamRtf

func (x *StatsResponse) GetMaxStreamRtf() float32

func (*StatsResponse) GetNStreams

func (x *StatsResponse) GetNStreams() int32

func (*StatsResponse) GetNTotalStreams

func (x *StatsResponse) GetNTotalStreams() int32

func (*StatsResponse) ProtoMessage

func (*StatsResponse) ProtoMessage()

func (*StatsResponse) ProtoReflect

func (x *StatsResponse) ProtoReflect() protoreflect.Message

func (*StatsResponse) Reset

func (x *StatsResponse) Reset()

func (*StatsResponse) String

func (x *StatsResponse) String() string

type StatsServiceClient

type StatsServiceClient interface {
	GetStats(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatsResponse, error)
}

StatsServiceClient is the client API for StatsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type StatsServiceServer

type StatsServiceServer interface {
	GetStats(context.Context, *emptypb.Empty) (*StatsResponse, error)
	// contains filtered or unexported methods
}

StatsServiceServer is the server API for StatsService service. All implementations must embed UnimplementedStatsServiceServer for forward compatibility

type StreamingRecognitionRequest

type StreamingRecognitionRequest struct {

	// Types that are assignable to StreamingRequest:
	//
	//	*StreamingRecognitionRequest_Config
	//	*StreamingRecognitionRequest_AudioContent
	StreamingRequest isStreamingRecognitionRequest_StreamingRequest `protobuf_oneof:"streaming_request"`
	// contains filtered or unexported fields
}

func (*StreamingRecognitionRequest) Descriptor deprecated

func (*StreamingRecognitionRequest) Descriptor() ([]byte, []int)

Deprecated: Use StreamingRecognitionRequest.ProtoReflect.Descriptor instead.

func (*StreamingRecognitionRequest) GetAudioContent

func (x *StreamingRecognitionRequest) GetAudioContent() []byte

func (*StreamingRecognitionRequest) GetConfig

func (*StreamingRecognitionRequest) GetStreamingRequest

func (m *StreamingRecognitionRequest) GetStreamingRequest() isStreamingRecognitionRequest_StreamingRequest

func (*StreamingRecognitionRequest) ProtoMessage

func (*StreamingRecognitionRequest) ProtoMessage()

func (*StreamingRecognitionRequest) ProtoReflect

func (*StreamingRecognitionRequest) Reset

func (x *StreamingRecognitionRequest) Reset()

func (*StreamingRecognitionRequest) String

func (x *StreamingRecognitionRequest) String() string

type StreamingRecognitionRequest_AudioContent

type StreamingRecognitionRequest_AudioContent struct {
	AudioContent []byte `protobuf:"bytes,2,opt,name=audio_content,json=audioContent,proto3,oneof"`
}

type StreamingRecognitionRequest_Config

type StreamingRecognitionRequest_Config struct {
	Config *RecognitionConfig `protobuf:"bytes,1,opt,name=config,proto3,oneof"`
}

type StreamingRecognitionResponse

type StreamingRecognitionResponse struct {
	Chunks []*SpeechRecognitionChunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamingRecognitionResponse) Descriptor deprecated

func (*StreamingRecognitionResponse) Descriptor() ([]byte, []int)

Deprecated: Use StreamingRecognitionResponse.ProtoReflect.Descriptor instead.

func (*StreamingRecognitionResponse) GetChunks

func (*StreamingRecognitionResponse) ProtoMessage

func (*StreamingRecognitionResponse) ProtoMessage()

func (*StreamingRecognitionResponse) ProtoReflect

func (*StreamingRecognitionResponse) Reset

func (x *StreamingRecognitionResponse) Reset()

func (*StreamingRecognitionResponse) String

type SttServiceClient

type SttServiceClient interface {
	StreamingRecognize(ctx context.Context, opts ...grpc.CallOption) (SttService_StreamingRecognizeClient, error)
}

SttServiceClient is the client API for SttService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewSttServiceClient

func NewSttServiceClient(cc grpc.ClientConnInterface) SttServiceClient

type SttServiceServer

type SttServiceServer interface {
	StreamingRecognize(SttService_StreamingRecognizeServer) error
	// contains filtered or unexported methods
}

SttServiceServer is the server API for SttService service. All implementations must embed UnimplementedSttServiceServer for forward compatibility

type SttService_StreamingRecognizeClient

type SttService_StreamingRecognizeClient interface {
	Send(*StreamingRecognitionRequest) error
	Recv() (*StreamingRecognitionResponse, error)
	grpc.ClientStream
}

type SttService_StreamingRecognizeServer

type SttService_StreamingRecognizeServer interface {
	Send(*StreamingRecognitionResponse) error
	Recv() (*StreamingRecognitionRequest, error)
	grpc.ServerStream
}

type UnimplementedStatsServiceServer

type UnimplementedStatsServiceServer struct {
}

UnimplementedStatsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedStatsServiceServer) GetStats

type UnimplementedSttServiceServer

type UnimplementedSttServiceServer struct {
}

UnimplementedSttServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSttServiceServer) StreamingRecognize

type UnsafeStatsServiceServer

type UnsafeStatsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatsServiceServer will result in compilation errors.

type UnsafeSttServiceServer

type UnsafeSttServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeSttServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SttServiceServer will result in compilation errors.

type WordInfo

type WordInfo struct {
	StartTime  *durationpb.Duration `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime    *durationpb.Duration `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	Word       string               `protobuf:"bytes,3,opt,name=word,proto3" json:"word,omitempty"`
	Confidence float32              `protobuf:"fixed32,4,opt,name=confidence,proto3" json:"confidence,omitempty"`
	// contains filtered or unexported fields
}

func (*WordInfo) Descriptor deprecated

func (*WordInfo) Descriptor() ([]byte, []int)

Deprecated: Use WordInfo.ProtoReflect.Descriptor instead.

func (*WordInfo) GetConfidence

func (x *WordInfo) GetConfidence() float32

func (*WordInfo) GetEndTime

func (x *WordInfo) GetEndTime() *durationpb.Duration

func (*WordInfo) GetStartTime

func (x *WordInfo) GetStartTime() *durationpb.Duration

func (*WordInfo) GetWord

func (x *WordInfo) GetWord() string

func (*WordInfo) ProtoMessage

func (*WordInfo) ProtoMessage()

func (*WordInfo) ProtoReflect

func (x *WordInfo) ProtoReflect() protoreflect.Message

func (*WordInfo) Reset

func (x *WordInfo) Reset()

func (*WordInfo) String

func (x *WordInfo) String() string

Jump to

Keyboard shortcuts

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