Package im.zego.zegoexpress.internal
Class ZegoCopyrightedMusicInternalImpl
- java.lang.Object
-
- im.zego.zegoexpress.ZegoCopyrightedMusic
-
- im.zego.zegoexpress.internal.ZegoCopyrightedMusicInternalImpl
-
public class ZegoCopyrightedMusicInternalImpl extends ZegoCopyrightedMusic
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.ConcurrentHashMap<ZegoCopyrightedMusic,im.zego.zegoexpress.internal.ZegoCopyrightedMusicInternalImpl.IdxAndHandler>
copyrightedMusicToIdxAndEventhandler
static android.os.Handler
mUIHandler
-
Constructor Summary
Constructors Constructor Description ZegoCopyrightedMusicInternalImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelDownload(java.lang.String resourceID)
Cancel download of music resource.void
clearCache()
Clear cache.static ZegoCopyrightedMusic
createCopyrightedMusic()
static void
destroyCopyrightedMusic(ZegoCopyrightedMusic copyrightedMusic)
void
download(java.lang.String resourceID, IZegoCopyrightedMusicDownloadCallback callback)
Download music resource.int
getAverageScore(java.lang.String resourceID)
Get average score.long
getCacheSize()
Get cache size.int
getCurrentPitch(java.lang.String resourceID)
Get real-time pitch data.long
getDuration(java.lang.String resourceID)
Get the playing time of a song or accompaniment file.int
getFullScore(java.lang.String resourceID)
Get full score .void
getKrcLyricByToken(java.lang.String krcToken, IZegoCopyrightedMusicGetKrcLyricByTokenCallback callback)
Get lyrics in krc format.void
getLrcLyric(ZegoCopyrightedMusicGetLyricConfig config, IZegoCopyrightedMusicGetLrcLyricCallback callback)
Get lyrics in lrc format.void
getLrcLyric(java.lang.String songID, IZegoCopyrightedMusicGetLrcLyricCallback callback)
[Deprecated] Get lyrics in lrc format.void
getLrcLyric(java.lang.String songID, ZegoCopyrightedMusicVendorID vendorID, IZegoCopyrightedMusicGetLrcLyricCallback callback)
Get lyrics in lrc format.void
getMusicByToken(java.lang.String songToken, IZegoCopyrightedMusicGetMusicByTokenCallback callback)
[Deprecated] Get a song or accompaniment.int
getPreviousScore(java.lang.String resourceID)
Get the score of the previous sentence.void
getSharedResource(ZegoCopyrightedMusicGetSharedConfig config, ZegoCopyrightedMusicResourceType type, IZegoCopyrightedMusicGetSharedResourceCallback callback)
Get shared music resource.void
getSharedResource(ZegoCopyrightedMusicGetSharedConfigV2 config, IZegoCopyrightedMusicGetSharedResourceCallback callback)
Get shared music resource.void
getStandardPitch(java.lang.String resourceID, IZegoCopyrightedMusicGetStandardPitchCallback callback)
Get standard pitch data.int
getTotalScore(java.lang.String resourceID)
Get total score .void
initCopyrightedMusic(ZegoCopyrightedMusicConfig config, IZegoCopyrightedMusicInitCallback callback)
Initialize the copyrighted music module.int
pauseScore(java.lang.String resourceID)
Pause scoring.boolean
queryCache(ZegoCopyrightedMusicQueryCacheConfig config)
Query the resource's cache is existed or not.boolean
queryCache(ZegoCopyrightedMusicQueryCacheConfigV2 config)
Query the resource's cache is existed or not.boolean
queryCache(java.lang.String songID, ZegoCopyrightedMusicType type)
[Deprecated] Query the resource's cache is existed or not.boolean
queryCache(java.lang.String songID, ZegoCopyrightedMusicType type, ZegoCopyrightedMusicVendorID vendorID)
[Deprecated] Query the resource's cache is existed or not.void
requestAccompaniment(ZegoCopyrightedMusicRequestConfig config, IZegoCopyrightedMusicRequestAccompanimentCallback callback)
[Deprecated] Request accompaniment.void
requestAccompanimentClip(ZegoCopyrightedMusicRequestConfig config, IZegoCopyrightedMusicRequestAccompanimentClipCallback callback)
[Deprecated] Request accompaniment clip.void
requestResource(ZegoCopyrightedMusicRequestConfig config, ZegoCopyrightedMusicResourceType type, IZegoCopyrightedMusicRequestResourceCallback callback)
Request music resource.void
requestResource(ZegoCopyrightedMusicRequestConfigV2 config, IZegoCopyrightedMusicRequestResourceCallback callback)
Request music resource.void
requestSong(ZegoCopyrightedMusicRequestConfig config, IZegoCopyrightedMusicRequestSongCallback callback)
[Deprecated] Request a song.int
resetScore(java.lang.String resourceID)
Reset scoring.int
resumeScore(java.lang.String resourceID)
Resume scoring.void
sendExtendedRequest(java.lang.String command, java.lang.String params, IZegoCopyrightedMusicSendExtendedRequestCallback callback)
Send extended feature request.void
setEventHandler(IZegoCopyrightedMusicEventHandler handler)
set copyrighted music event handler.void
setScoringLevel(int level)
Set the difficulty level of scoring.int
startScore(java.lang.String resourceID, int pitchValueInterval)
Start scoring.int
stopScore(java.lang.String resourceID)
Stop scoring.
-
-
-
Field Detail
-
mUIHandler
public static android.os.Handler mUIHandler
-
copyrightedMusicToIdxAndEventhandler
public static java.util.concurrent.ConcurrentHashMap<ZegoCopyrightedMusic,im.zego.zegoexpress.internal.ZegoCopyrightedMusicInternalImpl.IdxAndHandler> copyrightedMusicToIdxAndEventhandler
-
-
Method Detail
-
createCopyrightedMusic
public static ZegoCopyrightedMusic createCopyrightedMusic()
-
destroyCopyrightedMusic
public static void destroyCopyrightedMusic(ZegoCopyrightedMusic copyrightedMusic)
-
setEventHandler
public void setEventHandler(IZegoCopyrightedMusicEventHandler handler)
Description copied from class:ZegoCopyrightedMusic
set copyrighted music event handler. Available since: 2.13.0 Description: Set the callback function of the copyrighted music module, which can receive callback notifications related to song playback status . When to call: After create the copyrighted music [createCopyrightedMusic].- Specified by:
setEventHandler
in classZegoCopyrightedMusic
- Parameters:
handler
- The object used to receive copyrighted music callbacks.
-
initCopyrightedMusic
public void initCopyrightedMusic(ZegoCopyrightedMusicConfig config, IZegoCopyrightedMusicInitCallback callback)
Description copied from class:ZegoCopyrightedMusic
Initialize the copyrighted music module. Available since: 2.13.0 Description: Initialize the copyrighted music so that you can use the function of the copyrighted music later. When to call: After call [createCopyrightedMusic] and [loginRoom]. Caution: 1. The real user information must be passed in, otherwise the song resources cannot be obtained for playback. 2. The user ID set when initializing copyrighted music needs to be the same as the user ID set when logging in to the room.- Specified by:
initCopyrightedMusic
in classZegoCopyrightedMusic
- Parameters:
config
- the copyrighted music configuration.callback
- init result
-
getCacheSize
public long getCacheSize()
Description copied from class:ZegoCopyrightedMusic
Get cache size. Available since: 2.13.0 Description: When using this module, some cache files may be generated, and the size of the cache file can be obtained through this interface. Use case: Used to display the cache size of the App. When to call: After initializing the copyrighted music [createCopyrightedMusic].- Specified by:
getCacheSize
in classZegoCopyrightedMusic
- Returns:
- cache file size, in byte.
-
clearCache
public void clearCache()
Description copied from class:ZegoCopyrightedMusic
Clear cache. Available since: 2.13.0 Description: When using this module, some cache files may be generated, which can be cleared through this interface. Use case: Used to clear the cache of the App. When to call: After initializing the copyrighted music [createCopyrightedMusic].- Specified by:
clearCache
in classZegoCopyrightedMusic
-
sendExtendedRequest
public void sendExtendedRequest(java.lang.String command, java.lang.String params, IZegoCopyrightedMusicSendExtendedRequestCallback callback)
Description copied from class:ZegoCopyrightedMusic
Send extended feature request. Available since: 2.13.0 Description: Initialize the copyrighted music so that you can use the function of the copyrighted music later. Use case: Used to get a list of songs. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
sendExtendedRequest
in classZegoCopyrightedMusic
- Parameters:
command
- request command, details about the commands supported.params
- request parameters, each request command has corresponding request parameters.callback
- send extended feature request result
-
getLrcLyric
public void getLrcLyric(java.lang.String songID, IZegoCopyrightedMusicGetLrcLyricCallback callback)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Get lyrics in lrc format. Deprecated since 3.2.1, please use the method with the same name with [vendorID] parameter instead. Available since: 2.13.0 Description: Get lyrics in lrc format, support parsing lyrics line by line. Use case: Used to display lyrics line by line. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
getLrcLyric
in classZegoCopyrightedMusic
- Parameters:
songID
- the ID of the song or accompaniment, the song and accompaniment of a song share the same ID.callback
- get lyrics result
-
getLrcLyric
public void getLrcLyric(java.lang.String songID, ZegoCopyrightedMusicVendorID vendorID, IZegoCopyrightedMusicGetLrcLyricCallback callback)
Description copied from class:ZegoCopyrightedMusic
Get lyrics in lrc format. Available since: 3.2.1 Description: Get lyrics in lrc format, support parsing lyrics line by line. Use case: Used to display lyrics line by line. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
getLrcLyric
in classZegoCopyrightedMusic
- Parameters:
songID
- the ID of the song or accompaniment, the song and accompaniment of a song share the same ID.vendorID
- Copyright music resource song copyright provider.callback
- get lyrics result
-
getLrcLyric
public void getLrcLyric(ZegoCopyrightedMusicGetLyricConfig config, IZegoCopyrightedMusicGetLrcLyricCallback callback)
Description copied from class:ZegoCopyrightedMusic
Get lyrics in lrc format. Available since: 3.12.0 Description: Get lyrics in lrc format, support parsing lyrics line by line. Use case: Used to display lyrics line by line. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
getLrcLyric
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of get lyric.callback
- get lyrics result
-
getKrcLyricByToken
public void getKrcLyricByToken(java.lang.String krcToken, IZegoCopyrightedMusicGetKrcLyricByTokenCallback callback)
Description copied from class:ZegoCopyrightedMusic
Get lyrics in krc format. Available since: 2.13.0 Description: Get verbatim lyrics, support parsing lyrics word by word. Use case: Used to display lyrics word by word. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
getKrcLyricByToken
in classZegoCopyrightedMusic
- Parameters:
krcToken
- The krcToken obtained when calling [requestResource] for accompaniment or climax clips, or when obtaining shared resources through the [getSharedResource] interface. For more details, please refer to https://doc-zh.zego.im/article/15079#2_2callback
- get lyrics result.
-
requestSong
public void requestSong(ZegoCopyrightedMusicRequestConfig config, IZegoCopyrightedMusicRequestSongCallback callback)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Request a song. Deprecated since 3.0.2, please use the [requestResource] function instead. Available since: 2.13.0 Description: By requesting a song, you can not only obtain basic information about a song (such as duration, song name, and artist), but also obtain the resource ID for local playback, share_token for sharing with others, and related authentication information. Support by the time, by the user monthly, by the room monthly subscription three ways. Use case: Get copyrighted songs for local playback and sharing. When to call: After initializing the copyrighted music success [initCopyrightedMusic]. Caution: This interface will trigger billing. A song may have three sound qualities: normal, high-definition, and lossless. Each sound quality has a different resource file, and each resource file has a unique resource ID.- Specified by:
requestSong
in classZegoCopyrightedMusic
- Parameters:
config
- request configuration.callback
- request a song result
-
requestAccompaniment
public void requestAccompaniment(ZegoCopyrightedMusicRequestConfig config, IZegoCopyrightedMusicRequestAccompanimentCallback callback)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Request accompaniment. Deprecated since 3.0.2, please use the [requestResource] function instead. Available since: 2.13.0 Description: You can get the accompaniment resources of the song corresponding to the songID, including resource_id, krc_token, share_token, etc. Supports click-by-point accompaniment. Use case: Get copyrighted accompaniment for local playback and sharing. When to call: After initializing the copyrighted music success [initCopyrightedMusic]. Caution: This interface will trigger billing.- Specified by:
requestAccompaniment
in classZegoCopyrightedMusic
- Parameters:
config
- request configuration.callback
- request accompaniment result.
-
requestAccompanimentClip
public void requestAccompanimentClip(ZegoCopyrightedMusicRequestConfig config, IZegoCopyrightedMusicRequestAccompanimentClipCallback callback)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Request accompaniment clip. Deprecated since 3.0.2, please use the [requestResource] function instead. Available since: 2.13.0 Description: You can get the accompaniment clip resources of the song corresponding to the songID, including resource_id, krc_token, share_token, etc. Supports accompaniment clips by pay-per-use. Use case: Get copyrighted accompaniment clip for local playback and sharing. When to call: After initializing the copyrighted music success [initCopyrightedMusic]. Caution: This interface will trigger billing.- Specified by:
requestAccompanimentClip
in classZegoCopyrightedMusic
- Parameters:
config
- request configuration.callback
- request accompaniment clip result.
-
getMusicByToken
public void getMusicByToken(java.lang.String songToken, IZegoCopyrightedMusicGetMusicByTokenCallback callback)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Get a song or accompaniment. Deprecated since 3.0.2, please use the [getSharedResource] function instead. Available since: 2.13.0 Description: After the user successfully obtains the song/accompaniment/accompaniment clip resource, he can get the corresponding shareToken, share the shareToken with other users, and other users call this interface to obtain the shared music resources. Use case: In the online KTV scene, after receiving the song or accompaniment token shared by the lead singer, the chorus obtains the corresponding song or accompaniment through this interface, and then plays it on the local end. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
getMusicByToken
in classZegoCopyrightedMusic
- Parameters:
songToken
- access the corresponding authorization token for a song or accompaniment.callback
- get a song or accompaniment result.
-
requestResource
public void requestResource(ZegoCopyrightedMusicRequestConfig config, ZegoCopyrightedMusicResourceType type, IZegoCopyrightedMusicRequestResourceCallback callback)
Description copied from class:ZegoCopyrightedMusic
Request music resource. Available since: 3.0.2 Description: In addition to obtaining the basic information of the song (duration, song name, singer, etc.), and the most important resource id that can be used for local playback, there are also some related authentications information. Use case: Get copyrighted songs for local playback and sharing. Related APIs: After a user in the room successfully calls this interface to request a music resource, other users in the room can call the [getsharedresource] interface to get the music resource for free once. When to call: After initializing the copyrighted music [initCopyrightedMusic]. Note: 1. Each resource has a unique resource ID. 2. Every time this API is called, it will be billed once, please consult ZEGO business personnel for details. 3. Each resource has a unique resource ID. The resources obtained by calling this API are time-sensitive, the valid duration is the minimum value between the SDK life cycle and 24-hour.- Specified by:
requestResource
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of requesting music resource.type
- The resource type of music.callback
- Callback of requesting music resource.
-
requestResource
public void requestResource(ZegoCopyrightedMusicRequestConfigV2 config, IZegoCopyrightedMusicRequestResourceCallback callback)
Description copied from class:ZegoCopyrightedMusic
Request music resource. Available since: 3.12.0 Description: In addition to obtaining the basic information of the song (duration, song name, singer, etc.), and the most important resource id that can be used for local playback, there are also some related authentications information. Use case: Get copyrighted songs for local playback and sharing. Related APIs: After a user in the room successfully calls this interface to request a music resource, other users in the room can call the [getsharedresource] interface to get the music resource for free once. When to call: After initializing the copyrighted music [initCopyrightedMusic]. Note: 1. Each resource has a unique resource ID. 2. Every time this API is called, it will be billed once, please consult ZEGO business personnel for details. 3. Each resource has a unique resource ID. The resources obtained by calling this API are time-sensitive, the valid duration is the minimum value between the SDK life cycle and 24-hour.- Specified by:
requestResource
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of requesting music resource.callback
- Callback of requesting music resource.
-
getSharedResource
public void getSharedResource(ZegoCopyrightedMusicGetSharedConfig config, ZegoCopyrightedMusicResourceType type, IZegoCopyrightedMusicGetSharedResourceCallback callback)
Description copied from class:ZegoCopyrightedMusic
Get shared music resource. Available since: 3.0.2 Description: In addition to obtaining the basic information of the song (duration, song name, singer, etc.), and the most important resource id that can be used for local playback, there are also some related authentications information. Use case: Get copyrighted songs for local playback. Related APIs: After a user in the room calls the [requestresource] interface to request a music resource successfully, other users in the room can call this interface to get the music resource for free once. When to call: After initializing the copyrighted music [initCopyrightedMusic]. Note: Each resource has a unique resource ID. The resources obtained by calling this API are time-sensitive, the valid duration is the minimum value between the SDK life cycle and 24-hour.- Specified by:
getSharedResource
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of getting shared music resource.type
- The resource type of music.callback
- Callback of getting shared music resource.
-
getSharedResource
public void getSharedResource(ZegoCopyrightedMusicGetSharedConfigV2 config, IZegoCopyrightedMusicGetSharedResourceCallback callback)
Description copied from class:ZegoCopyrightedMusic
Get shared music resource. Available since: 3.12.0 Description: In addition to obtaining the basic information of the song (duration, song name, singer, etc.), and the most important resource id that can be used for local playback, there are also some related authentications information. Use case: Get copyrighted songs for local playback. Related APIs: After a user in the room calls the [requestresource] interface to request a music resource successfully, other users in the room can call this interface to get the music resource for free once. When to call: After initializing the copyrighted music [initCopyrightedMusic]. Note: Each resource has a unique resource ID. The resources obtained by calling this API are time-sensitive, the valid duration is the minimum value between the SDK life cycle and 24-hour.- Specified by:
getSharedResource
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of getting shared music resource.callback
- Callback of getting shared music resource.
-
download
public void download(java.lang.String resourceID, IZegoCopyrightedMusicDownloadCallback callback)
Description copied from class:ZegoCopyrightedMusic
Download music resource. Available since: 2.13.0 Description: Download music resource. It can only be played after downloading successfully. Use case: After obtaining the music resource authorization, use this interface to download the corresponding resources. When to call: After initializing the copyrighted music success [initCopyrightedMusic]. Caution: Downloading copyrighted music resources is affected by the Internet.- Specified by:
download
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the song or accompaniment.callback
- download song or accompaniment result.
-
cancelDownload
public void cancelDownload(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Cancel download of music resource. Available since: 3.11.0 Description: Cancel download of music resource. Use case: After starting to download music resources, use this interface to cancel the corresponding download task. When to call: After starting the download [download]. Caution: When a valid resourceID is passed in, only unfinished download tasks will be cancelled. When empty is passed in, all unfinished download tasks will be canceled.- Specified by:
cancelDownload
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the song or accompaniment.
-
queryCache
public boolean queryCache(java.lang.String songID, ZegoCopyrightedMusicType type)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Query the resource's cache is existed or not. Deprecated since 3.2.1, please use the method with the same name with [vendorID] parameter instead. Available since: 2.13.0 Description: Query the resource is existed or not. Use case: Can be used to check the resource's cache is existed or not When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
queryCache
in classZegoCopyrightedMusic
- Parameters:
songID
- the ID of the song or accompaniment, the song and accompaniment of a song share the same ID.type
- the song resource type.
-
queryCache
public boolean queryCache(java.lang.String songID, ZegoCopyrightedMusicType type, ZegoCopyrightedMusicVendorID vendorID)
Description copied from class:ZegoCopyrightedMusic
[Deprecated] Query the resource's cache is existed or not. Deprecated since 3.9.0, please use the method with the same name with [config] parameter instead. Available since: 3.2.1 Description: Query the resource is existed or not, query the Yinsuda resource cache by default Use case: Can be used to check the resource's cache is existed or not When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
queryCache
in classZegoCopyrightedMusic
- Parameters:
songID
- the ID of the song or accompaniment, the song and accompaniment of a song share the same ID.type
- the song resource type.vendorID
- Copyright music resource song copyright provider.
-
queryCache
public boolean queryCache(ZegoCopyrightedMusicQueryCacheConfig config)
Description copied from class:ZegoCopyrightedMusic
Query the resource's cache is existed or not. Available since: 3.9.0 Description: Query the resource is existed or not, query the Yinsuda resource cache by default Use case: Can be used to check the resource's cache is existed or not When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
queryCache
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of querying cache.
-
queryCache
public boolean queryCache(ZegoCopyrightedMusicQueryCacheConfigV2 config)
Description copied from class:ZegoCopyrightedMusic
Query the resource's cache is existed or not. Available since: 3.12.0 Description: Query the resource is existed or not, query the Yinsuda resource cache by default Use case: Can be used to check the resource's cache is existed or not When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
queryCache
in classZegoCopyrightedMusic
- Parameters:
config
- The configuration of querying cache.
-
getDuration
public long getDuration(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Get the playing time of a song or accompaniment file. Available since: 2.13.0 Description: Get the playing time of a song or accompaniment file. Use case: Can be used to display the playing time information of the song or accompaniment on the view. When to call: After initializing the copyrighted music success [initCopyrightedMusic].- Specified by:
getDuration
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the song or accompaniment.
-
setScoringLevel
public void setScoringLevel(int level)
Description copied from class:ZegoCopyrightedMusic
Set the difficulty level of scoring. Available since: 2.22.0 Description: Users can set the scoring difficulty level through this function. When to call: After calling [initCopyrightedMusic] to initialize copyrighted music successfully, call [startScore] to start scoring. Default value: When this function is not called, the difficulty level of scoring is 4. Restrictions: This function does not support dynamic settings. After calling this function successfully, the next call to [startScore] will take effect.- Specified by:
setScoringLevel
in classZegoCopyrightedMusic
- Parameters:
level
- The difficulty level of scoring. The level ranges from 0 to 4. The scoring difficulty decreases from 0 to 4.
-
startScore
public int startScore(java.lang.String resourceID, int pitchValueInterval)
Description copied from class:ZegoCopyrightedMusic
Start scoring. Available since: 2.15.0 Description: Start the scoring function.After starting scoring, the scoring result OnCurrentPitchValueUpdate callback will be received according to the set callback time interval. Use case: Can be used to display the singing score on the view. When to call: After obtaining verbatim lyrics and playing the accompaniment resources of copyrighted music. Restrictions: Only support use this api after [startPublishingStream].- Specified by:
startScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.pitchValueInterval
- the time interval of real-time pitch line callback, in milliseconds, the default is 50 milliseconds.
-
pauseScore
public int pauseScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Pause scoring. Available since: 2.15.0 Description: Pause ongoing scoring,will stop the [OnCurrentPitchValueUpdate] callback. Use case: You can call this interface to pause the scoring function while scoring. When to call: It can be called while grading.- Specified by:
pauseScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
resumeScore
public int resumeScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Resume scoring. Available since: 2.15.0 Description: Resume currently paused scoring. Use case: When there is currently paused scoring, this interface can be called to resume the scoring function. When to call: It can be called when there is currently a paused scoring.- Specified by:
resumeScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
stopScore
public int stopScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Stop scoring. Available since: 2.15.0 Description: End the current rating.The [OnCurrentPitchValueUpdate] callback will be stopped, but the average or total score can still be obtained normally. Use case: You can call this interface to end the scoring while scoring. When to call: It can be called while grading.- Specified by:
stopScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
resetScore
public int resetScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Reset scoring. Available since: 2.15.0 Description: Reset the scores that have already been performed,The [OnCurrentPitchValueUpdate] callback will be stopped and the average or total score will be 0. Use case: Often used in scenes where the same song is re-sung. When to call: It can be called after scoring has been performed.- Specified by:
resetScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
getPreviousScore
public int getPreviousScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Get the score of the previous sentence. Available since: 2.15.0 Description: Get the score of the previous sentence. Use case: Can be used to display the score of each sentence on the view. When to call: It can be called after playing the copyright accompaniment or accompaniment clip and starting to score.- Specified by:
getPreviousScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
getAverageScore
public int getAverageScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Get average score. Available since: 2.15.0 Description: Get the average score. Use case: Can be used to display the average score on the view. When to call: It can be called after playing the copyright accompaniment or accompaniment clip and starting to score.- Specified by:
getAverageScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
getTotalScore
public int getTotalScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Get total score . Available since: 2.15.0 Description: Get the total score. Use case: Can be used to display the total score on the view. When to call: It can be called after playing the copyright accompaniment or accompaniment clip and starting to score.- Specified by:
getTotalScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
getFullScore
public int getFullScore(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Get full score . Available since: 3.0.2 Description: Get the full score. Use case: Can be used to display the full score on the view. When to call: It can be called after playing the copyright accompaniment or accompaniment clip and starting to score.- Specified by:
getFullScore
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.
-
getStandardPitch
public void getStandardPitch(java.lang.String resourceID, IZegoCopyrightedMusicGetStandardPitchCallback callback)
Description copied from class:ZegoCopyrightedMusic
Get standard pitch data. Available since: 2.15.0 Description: Get standard pitch data. Use case: Can be used to display standard pitch lines on the view. Cation: Only accompaniment or climactic clip assets have pitch lines.- Specified by:
getStandardPitch
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the accompaniment or accompaniment clip.callback
- get standard pitch data result.
-
getCurrentPitch
public int getCurrentPitch(java.lang.String resourceID)
Description copied from class:ZegoCopyrightedMusic
Get real-time pitch data. Available since: 2.15.0 Description: Get real-time pitch data. Use case: Can be used to display real-time pitch lines on the view. When to call: It can be called after playing the copyright accompaniment or accompaniment clip and starting to score.- Specified by:
getCurrentPitch
in classZegoCopyrightedMusic
- Parameters:
resourceID
- the resource ID corresponding to the song or accompaniment.
-
-