getMusicCollectionByMusicChartId

Retrieves the list of music resources for the specified music chart ID.

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

After calling this method, the SDK triggers the onMusicCollectionResult callback to report details of the music resources in the chart.

Parameters

requestId
The request ID, used to uniquely identify the request.
musicChartId
The ID of the music chart. You can obtain this ID via the onMusicChartsResult callback or by using the RESTful API to get the full or incremental music library list.
page
The current page number, starting from 1.
pageSize
The 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. See the error code documentation for details and resolution suggestions.