getInternalSongCode

Creates an internal song code for the chorus segment of a music resource.

virtual int getInternalSongCode(int64_t songCode, const char* jsonOption, int64_t& internalSongCode) = 0;

Before playing the chorus segment of a music resource, you need to call this method with the parameters jsonOption and the music resource's songCode to create an internal song code for the chorus segment. This code serves as the unique identifier for the resource. After obtaining this code, pass it as the songCode parameter when calling methods to open, preload, or remove the resource.

Parameters

songCode
The song code of the music resource, used to identify the resource. You can obtain it by calling getMusicCollectionByMusicChartId or searchMusic, and retrieve the code from the onMusicCollectionResult callback triggered by these methods.
jsonOption
Extended JSON field, default is NULL. Currently supports the following fields:
  • sceneType: Scene type. 1: Live streaming scene, online karaoke room and background music playback; 2: Live streaming scene, background music playback; 3: (default) Voice chat scene, online karaoke room; 4: Voice chat scene, background music playback; 5: VR scene, online karaoke room and background music playback. Example code: {"sceneType":1}.
  • highPart: Index of the chorus segment, obtained from the onMusicCollectionResult callback, index starts from 0. Example code: {"format": {"highpart": 0}}.
internalSongCode
Output parameter, the internal song code of the music resource.

Return Values

  • 0: Success.
  • < 0: Failure. See error codes and resolution suggestions.