speaker

package
Version: v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package speaker provides functionality for creating speaker recognition applications and managing the related voice profiles

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProfileOutcome

type CreateProfileOutcome struct {
	common.OperationOutcome

	Profile *VoiceProfile
}

func (CreateProfileOutcome) Close

func (outcome CreateProfileOutcome) Close()

Close releases the underlying resources

type GetAllProfilesOutcome

type GetAllProfilesOutcome struct {
	common.OperationOutcome

	Profiles []*VoiceProfile
}

func (GetAllProfilesOutcome) Close

func (outcome GetAllProfilesOutcome) Close()

Close releases the underlying resources

type SpeakerIdentificationModel

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

SpeakerIdentificationModel is the class that defines a identification model to be used in speaker identification scenarios.

func NewSpeakerIdentificationModelFromProfiles

func NewSpeakerIdentificationModelFromProfiles(profiles []*VoiceProfile) (*SpeakerIdentificationModel, error)

NewSpeakerIdentificationModelFromProfile creates an instance of the identification model using the given voice profiles.

func (*SpeakerIdentificationModel) Close

func (model *SpeakerIdentificationModel) Close()

Close disposes the associated resources.

func (*SpeakerIdentificationModel) GetHandle

func (model *SpeakerIdentificationModel) GetHandle() common.SPXHandle

type SpeakerRecognitionOutcome

type SpeakerRecognitionOutcome struct {
	common.OperationOutcome

	// Result is the result of the operation
	Result *SpeakerRecognitionResult
}

SpeakerRecognitionOutcome is a wrapper type to be returned by operations returning SpeakerRecognitionResult and error

func (SpeakerRecognitionOutcome) Close

func (outcome SpeakerRecognitionOutcome) Close()

Close releases the underlying resources

type SpeakerRecognitionResult

type SpeakerRecognitionResult struct {

	// ResultID specifies the result identifier.
	ResultID string

	// Reason specifies status of speech synthesis result.
	Reason common.ResultReason

	// ProfileID specifies the recognized profile id.
	ProfileID string

	// Score specifies the confidence score for the recognized profile id.
	Score float64

	// ErrorDetails presents error details.
	ErrorDetails string

	// Collection of additional properties.
	Properties *common.PropertyCollection
	// contains filtered or unexported fields
}

SpeakerRecognitionResult contains information about result from voice profile operations.

func NewSpeakerRecognitionResultFromHandle

func NewSpeakerRecognitionResultFromHandle(handle common.SPXHandle) (*SpeakerRecognitionResult, error)

NewSpeakerRecognitionResultFromHandle creates a SpeakerRecognitionResult from a handle (for internal use)

func (SpeakerRecognitionResult) Close

func (result SpeakerRecognitionResult) Close()

Close releases the underlying resources

type SpeakerRecognizer

type SpeakerRecognizer struct {
	Properties *common.PropertyCollection
	// contains filtered or unexported fields
}

SpeakerRecognizer is the class for speaker recognizers.

func NewSpeakerRecognizerFromConfig

func NewSpeakerRecognizerFromConfig(config *speech.SpeechConfig, audioConfig *audio.AudioConfig) (*SpeakerRecognizer, error)

NewSpeakerRecognizerFromConfig creates a speaker recognizer from a speech config and audio config.

func (SpeakerRecognizer) AuthorizationToken

func (recognizer SpeakerRecognizer) AuthorizationToken() string

AuthorizationToken is the authorization token.

func (SpeakerRecognizer) Close

func (recognizer SpeakerRecognizer) Close()

Close disposes the associated resources.

func (SpeakerRecognizer) IdentifyOnceAsync

func (recognizer SpeakerRecognizer) IdentifyOnceAsync(model *SpeakerIdentificationModel) chan SpeakerRecognitionOutcome

IdentifyOnceAsync starts speaker verification, and returns a score indicates whether the profile in the model is verified or not

func (SpeakerRecognizer) SetAuthorizationToken

func (recognizer SpeakerRecognizer) SetAuthorizationToken(token string) error

SetAuthorizationToken sets the authorization token that will be used for connecting to the service. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. Otherwise, the recognizer will encounter errors during recognition.

func (SpeakerRecognizer) VerifyOnceAsync

func (recognizer SpeakerRecognizer) VerifyOnceAsync(model *SpeakerVerificationModel) chan SpeakerRecognitionOutcome

VerifyOnceAsync starts speaker verification, and returns a score indicates whether the profile in the model is verified or not

type SpeakerVerificationModel

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

SpeakerVerificationModel is the class that defines a verification model to be used in speaker verification scenarios.

func NewSpeakerVerificationModelFromProfile

func NewSpeakerVerificationModelFromProfile(profile *VoiceProfile) (*SpeakerVerificationModel, error)

NewSpeakerVerificationModelFromProfile creates an instance of the verification model using the given voice profile.

func (*SpeakerVerificationModel) Close

func (model *SpeakerVerificationModel) Close()

Close disposes the associated resources.

func (*SpeakerVerificationModel) GetHandle

func (model *SpeakerVerificationModel) GetHandle() common.SPXHandle

type VoiceProfile

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

VoiceProfile is the class that defines voice profiles used in speaker recognition scenarios.

func NewVoiceProfileFromIdAndType

func NewVoiceProfileFromIdAndType(id string, profileType common.VoiceProfileType) (*VoiceProfile, error)

NewVoiceProfileFromIdAndType creates an instance of the voice profile with specified id and type.

func (*VoiceProfile) Close

func (profile *VoiceProfile) Close()

Close disposes the associated resources.

func (*VoiceProfile) GetHandle

func (profile *VoiceProfile) GetHandle() common.SPXHandle

func (*VoiceProfile) Id

func (profile *VoiceProfile) Id() (string, error)

Return the id of the given voice profile

func (*VoiceProfile) Type

func (profile *VoiceProfile) Type() (common.VoiceProfileType, error)

Return the type of the given voice profile

type VoiceProfileCancellationDetails

type VoiceProfileCancellationDetails struct {
	Reason       common.CancellationReason
	ErrorCode    common.CancellationErrorCode
	ErrorDetails string
}

VoiceProfileCancellationDetails contains detailed information about why a result was canceled. Added in version 1.21.0

func NewCancellationDetailsFromVoiceProfileResult

func NewCancellationDetailsFromVoiceProfileResult(result *VoiceProfileResult) (*VoiceProfileCancellationDetails, error)

NewCancellationDetailsFromVoiceProfileResult creates the object from the speech synthesis result.

type VoiceProfileClient

type VoiceProfileClient struct {
	Properties *common.PropertyCollection
	// contains filtered or unexported fields
}

VoiceProfileClient connects to a speaker recognition backend.

func NewVoiceProfileClientFromConfig

func NewVoiceProfileClientFromConfig(config *speech.SpeechConfig) (*VoiceProfileClient, error)

NewVoiceProfileClientFromConfig creates a voice profile service client from a speech config. Users should use this function to create a voice profile client.

func (VoiceProfileClient) Close

func (client VoiceProfileClient) Close()

Close performs cleanup of resources.

func (VoiceProfileClient) CreateProfileAsync

func (client VoiceProfileClient) CreateProfileAsync(profileType common.VoiceProfileType, locale string) chan CreateProfileOutcome

CreateProfileAsync attempts to create a new voice profile on the service.

func (VoiceProfileClient) DeleteProfileAsync

func (client VoiceProfileClient) DeleteProfileAsync(profile *VoiceProfile) <-chan VoiceProfileOutcome

DeleteProfileAsync sends a profile delete request to the service.

func (VoiceProfileClient) EnrollProfileAsync

func (client VoiceProfileClient) EnrollProfileAsync(profile *VoiceProfile, audioConfig *audio.AudioConfig) chan VoiceProfileEnrollmentOutcome

EnrollProfileAsync sends audio for voice profile enrollment returns a result detailing enrollment status for the given profile

func (VoiceProfileClient) GetActivationPhrasesAsync

func (client VoiceProfileClient) GetActivationPhrasesAsync(profileType common.VoiceProfileType, locale string) chan VoiceProfilePhraseOutcome

GetActivationPhrasesAsync returns a result containing a list of activation phrases required for voice profile enrollment.

func (VoiceProfileClient) GetAllProfilesAsync

func (client VoiceProfileClient) GetAllProfilesAsync(profileType common.VoiceProfileType) chan GetAllProfilesOutcome

GetAllProfilesAsync attempts to create a new voice profile on the service.

func (VoiceProfileClient) ResetProfileAsync

func (client VoiceProfileClient) ResetProfileAsync(profile *VoiceProfile) <-chan VoiceProfileOutcome

ResetProfileAsync sends a profile reset request to the service.

func (VoiceProfileClient) RetrieveEnrollmentResultAsync

func (client VoiceProfileClient) RetrieveEnrollmentResultAsync(profile *VoiceProfile) chan VoiceProfileEnrollmentOutcome

RetrieveEnrollmentResultAsync returns a result detailing enrollment status for the given profile

type VoiceProfileEnrollmentOutcome

type VoiceProfileEnrollmentOutcome struct {
	common.OperationOutcome

	// Result is the result of the operation
	Result *VoiceProfileEnrollmentResult
}

VoiceProfileEnrollmentOutcome is a wrapper type to be returned by operations returning VoiceProfileEnrollmentResult and error

func (VoiceProfileEnrollmentOutcome) Close

func (outcome VoiceProfileEnrollmentOutcome) Close()

Close releases the underlying resources

type VoiceProfileEnrollmentResult

type VoiceProfileEnrollmentResult struct {

	// ResultID specifies the result identifier.
	ResultID string

	// ProfileID specifies the profile ID of the profile being enrolled.
	ProfileID string

	// EnrollmentsCount specifies the number of successful enrollments for the profile
	EnrollmentsCount int

	// RemainingEnrollmentsCount specifies the number of successful enrollments remaining until profile is enrolled
	RemainingEnrollmentsCount int

	// EnrollmentsLength specifies in hundreds of nanoseconds the audio length registered enrolling the profile
	EnrollmentsLength big.Int

	// RemainingEnrollmentsLength specifies the amount of pure speech (which is the amount of audio after removing silence and non-speech segments) needed to complete profile enrollment in hundred nanoseconds.
	RemainingEnrollmentsLength big.Int

	// CreatedTime specifies the created time of the voice profile.
	CreatedTime string

	// LastUpdatedDateTime specifies the last updated time of the voice profile.
	LastUpdatedTime string

	// Reason specifies status of speech synthesis result.
	Reason common.ResultReason

	// ErrorDetails presents error details.
	ErrorDetails string

	// Collection of additional properties.
	Properties *common.PropertyCollection
	// contains filtered or unexported fields
}

VoiceProfileEnrollmentResult contains information about result from voice profile operations.

func (VoiceProfileEnrollmentResult) Close

func (result VoiceProfileEnrollmentResult) Close()

Close releases the underlying resources

type VoiceProfileOutcome

type VoiceProfileOutcome struct {
	common.OperationOutcome

	// Result is the result of the operation
	Result *VoiceProfileResult
}

VoiceProfileOutcome is a wrapper type to be returned by operations returning VoiceProfileResult and error

func (VoiceProfileOutcome) Close

func (outcome VoiceProfileOutcome) Close()

Close releases the underlying resources

type VoiceProfilePhraseOutcome

type VoiceProfilePhraseOutcome struct {
	common.OperationOutcome

	// Result is the result of the operation
	Result *VoiceProfilePhraseResult
}

VoiceProfilePhraseOutcome is a wrapper type to be returned by operations returning VoiceProfilePhraseResult and error

func (VoiceProfilePhraseOutcome) Close

func (outcome VoiceProfilePhraseOutcome) Close()

Close releases the underlying resources

type VoiceProfilePhraseResult

type VoiceProfilePhraseResult struct {

	// Activation phrases for voice profile enrollment
	Phrases []string

	// ResultID specifies the result identifier.
	ResultID string

	// Reason specifies status of speech synthesis result.
	Reason common.ResultReason

	// ErrorDetails presents error details.
	ErrorDetails string

	// Collection of additional properties.
	Properties *common.PropertyCollection
	// contains filtered or unexported fields
}

VoiceProfilePhraseResult contains activation phrases needed to successfully enroll a voice profile.

func (VoiceProfilePhraseResult) Close

func (result VoiceProfilePhraseResult) Close()

Close releases the underlying resources

type VoiceProfileResult

type VoiceProfileResult struct {

	// ResultID specifies the result identifier.
	ResultID string

	// Reason specifies status of speech synthesis result.
	Reason common.ResultReason

	// ErrorDetails presents error details.
	ErrorDetails string

	// Collection of additional properties.
	Properties *common.PropertyCollection
	// contains filtered or unexported fields
}

VoiceProfileResult contains information about result from voice profile operations.

func (VoiceProfileResult) Close

func (result VoiceProfileResult) Close()

Close releases the underlying resources

Jump to

Keyboard shortcuts

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