searchMusic

Searches for music resources.

virtual int searchMusic(agora::util::AString& requestId, const char* keyWord, int32_t page, int32_t pageSize, const char* jsonOption = nullptr) = 0;

Parameters

requestId
The request ID, used to uniquely identify the request.
keyWord
Search keyword. Supports searching by song name or artist name.
page
The page number of the music resource list to retrieve.
pageSize
The maximum number of music resources returned per page, with a maximum value of 50.
jsonOption
Extended JSON field, default is NULL. You can use this field to filter the desired music resources. Currently supported filters:
  • pitchType: Whether scoring is supported:
    • 1: Scorable music.
    • 2: Non-scorable music.
  • needHighPart: Whether chorus segments are needed:
    • true: Chorus segments required.
    • false: Chorus segments not required.
Examples: {"pitchType":1}, {"needHighPart":true}.

Return Values

  • 0: Success.
  • < 0: Failure.