Copyright © 2005-2023 MultiMedia Soft

OnSoundRecognizerEvents event

Previous pageReturn to chapter overviewNext page

Remarks

 

Occurs during a sound recognition session started through one between the following methods:

- SoundRecognizer.StartOnPlayer

- SoundRecognizer.StartOnFile

- SoundRecognizer.StartOnMemory

- SoundRecognizer.StartOnWasapiDevice

 

This event replaces the usage of the CallbackForSoundRecognizerEvents delegate and is only intended for usage with applications developed using Visual Basic 6 (which results unreliable when dealing with delegates and callbacks) and, in order to be enabled, requires a call to the COMEventEnable method with the nEventType parameter set to EVENT_TYPE_SOUND_RECOGNIZER.

 

For further details about callback delegates see the How to synchronize the container application with the API tutorial.

For further details about the use of the sound recognizer see the SoundRecognizerMan class.

For details about sound recognition refer to the How to recognize music and obtain related information tutorial.

 

 

Syntax

 

[Visual Basic 6]

Private Sub DjStudioApi_OnSoundRecognizerEvents (

ByVal nEvent as enumYoutubeEvents,

ByVal nResult as enumErrorCodes,

ByVal nData1 as Int32,

ByVal nData2 as Int32,

ByVal pBufferUnicode as IntPtr,

ByVal nBufferLength as Int32

)

 

where "DjStudioApi" is declared in Visual Basic 6 code as:

 

Dim WithEvents DjStudioApi As AudioDjStudioApi.AudioDjStudioApiObj


 

 

Event Data

 

Parameter

Description

 

 

nEvent

Event reported .

Supported values are the following:

Mnemonic constant

Value

Meaning with data parameters

EV_SOUND_RECOGNITION_STARTED

0

A sound recognition session was started.

 

Involved data parameters:

None

EV_SOUND_RECOGNITION_DONE

1

A sound recognition session was completed.

 

Involved data parameters:

nParam1: The result of the recognition session, can be cast to a variable of type enumErrorCodes: see the LastError property for supported values

nUniqueId

Number representing the unique identifier of the recognition session started by one of the following methods:

SoundRecognizer.StartOnPlayer

SoundRecognizer.StartOnFile

SoundRecognizer.StartOnMemory

SoundRecognizer.StartOnWasapiDevice

nParam1

First 32 bits integer value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

nParam2

Second 32 bits integer value containing event specific data; currently reserved for future uses.