createSignatureGenerator

suspend fun createSignatureGenerator(audioSampleRateInHz: AudioSampleRateInHz): ShazamKitResult<ShazamKitException, SignatureGenerator>

Creates a SignatureGenerator, useful to generate a Signature from pre-recorded audio.

Example usage:

    viewModelScope.launch {
val signatureGenerator = when (val sigGeneratorResult = ShazamKit.createSignatureGenerator(sampleRate)) {
is Success -> sigGeneratorResult.data
is Failure -> error("Error: ${sigGeneratorResult.reason}")
}
}

This is safe to call on Main dispatcher.

Return

An ShazamKitResult object containing either the SignatureGenerator or an ShazamKitException if an error occurred.

Parameters

audioSampleRateInHz

The audio sample rate in Hz. Supported sample rates are defined as values of the enum AudioSampleRateInHz.