OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
song_recognition.song_recognition_if.SongRecognitionIf Class Reference

Recognize a short encoded audio sample and return normalized metadata. More...

Inheritance diagram for song_recognition.song_recognition_if.SongRecognitionIf:
song_recognition.acrcloud_song_recognizer.AcrCloudSongRecognizer song_recognition.unconfigured_song_recognizer.UnconfiguredSongRecognizer

Public Member Functions

bool is_configured (self)
 Return whether required provider configuration is available.
str|None provider_name (self)
 Return a human-readable provider name when configured.
SongRecognitionResult|None recognize (self, bytes audio, *, int|None sample_bytes=None)
 Return the best matching song, or None when unmatched.

Detailed Description

Recognize a short encoded audio sample and return normalized metadata.

Member Function Documentation

◆ is_configured()

bool song_recognition.song_recognition_if.SongRecognitionIf.is_configured ( self)

Return whether required provider configuration is available.

Returns
True when the provider has its required configuration.

Reimplemented in song_recognition.acrcloud_song_recognizer.AcrCloudSongRecognizer, and song_recognition.unconfigured_song_recognizer.UnconfiguredSongRecognizer.

◆ provider_name()

str | None song_recognition.song_recognition_if.SongRecognitionIf.provider_name ( self)

Return a human-readable provider name when configured.

Returns
Provider name, or None when unconfigured.

Reimplemented in song_recognition.acrcloud_song_recognizer.AcrCloudSongRecognizer, and song_recognition.unconfigured_song_recognizer.UnconfiguredSongRecognizer.

◆ recognize()

SongRecognitionResult | None song_recognition.song_recognition_if.SongRecognitionIf.recognize ( self,
bytes audio,
* ,
int | None sample_bytes = None )

Return the best matching song, or None when unmatched.

Parameters
audioEncoded audio sample sent to the recognition provider.
sample_bytesOptional decoded sample length for provider metadata.
Returns
Matching song metadata, or None when no match is found.

Reimplemented in song_recognition.acrcloud_song_recognizer.AcrCloudSongRecognizer, and song_recognition.unconfigured_song_recognizer.UnconfiguredSongRecognizer.


The documentation for this class was generated from the following file:
  • controllers/song_recognition/song_recognition_if.py