karaokekit 1.2.0 API

网易云信在线 K 歌解决方案为用户提供无限靠近线下唱歌体验的多人唱歌服务,房间内的用户可以进行独唱或合唱。K 歌场景方案 API 包含如下类:

Description
NEKaraokeErrorCode错误码
NEKaraokeSeatItemStatus麦位状态
NEKaraokeEndReason房间结束原因枚举
NEKaraokeAudioOutputDevice本地音频输出设备
NEKaraokeAuthEvent登录事件枚举
NEKaraokeLiveState直播状态
NEKaraokeKitNEKaraokeKit 核心类
NEKaraokeListenerKaraoke 房间事件监听

NEKaraokeKit 核心接口

Method Description
initialize NEKaraokeKit 初始化
addAuthListener 添加登录状态监听
removeAuthListener 移除登录状态监听
addKaraokeListener 注册房间监听
removeKaraokeListener 移除房间监听
login 登录
logout 登出
getKaraokeRoomList) 获取Karaoke房间列表
createRoom 创建 karaoke 房间
joinRoom 加入房间
leaveRoom) 离开房间
endRoom 结束房间
getSeatInfo 获取麦位信息。
getSeatRequestList 获取麦位申请列表。按照申请时间正序排序,先申请的成员排在列表前面。
requestSeat 申请上麦
cancelRequestSeat
取消申请上麦
approveRequestSeat 同意上麦
rejectRequestSeat 拒绝上麦
kickSeat 踢麦
leaveSeat 下麦
sendTextMessage 发送聊天室消息
kickMemberOut 踢出房间内成员
muteMyAudio 关闭自己的麦克风
unmuteMyAudio 打开自己的麦克风
playSong 开始播放歌曲
adjustPlayingSongVolume 调节播放歌曲音量
adjustRecordingSignalVolume 调节人声音量
setLocalVoicePitch 变调
setLocalVoiceReverbParam 设置 混响
setLocalVoiceEqualization 设置本地语音音效均衡,即自定义设置本地人声均衡波段的中心频率。
enableEarBack 开启耳返功能。
disableEarBack() 关闭耳返功能。
inviteChorus 发起合唱,点歌人才能发起
cancelInviteChorus 取消合唱,点歌人才能取消
joinChorus 加入合唱
rejectInviteChorus 拒绝合唱
chorusReady 副唱 伴奏等资源完成后调用,通知可以合唱了,只有副唱可用
abandonSong 放弃演唱,只有当前点这首歌的人才能调用
requestPlaySong 开始演唱,房主、主唱、副唱可用
requsetPausePlayingSong 暂停歌曲,房主、主唱、副唱可用
requestResumePlayingSong 恢复播放,房主、主唱、副唱可用
requestStopPlayingSong 停止播放,房主、主唱、副唱可用
requestPlayingSongInfo 获取当前正在播放的信息
setPlayingPosition 指定播放位置
switchAccompaniment 切换原唱/伴音
isOriginalSongPlaying() 当前是否是原唱
currentSongIdForAudioEffect() 调音台使用的音效Id
sendGift 发送礼物
getOrderedSongs 获取已点歌曲列表
orderSong 选择歌曲
deleteSong 删除歌曲
topSong 置顶歌曲
nextSong 切歌
getSongToken 更新歌曲token
getSongDynamicTokenUntilSuccess 刷新版权token。网络导致的失败会重试
getLocalMember() 本端成员信息 NEKaraokeMember 加入房间后获取
getAllMemberList() 所有成员(包括本端) 加入房间后获取
getIsInitialized() 初始化状态true 已初始化 false 未初始化
getIsLoggedIn() 是否已经登录

Karaoke 房间事件监听

Method Description
onMemberJoinRoom 成员进入房间回调
onMemberLeaveRoom 成员离开房间回调
onRoomEnded 房间结束回调
onRtcChannelError RTC频道错误回调
onAudioOutputDeviceChanged 本端音频输出设备变更通知,如切换到扬声器、听筒、耳机等
onMemberAudioMuteChanged 成员音频状态回调
onReceiveTextMessage 聊天室消息回调
onReceiveChorusMessage 收到合唱邀请
onReceiveGift 收到礼物
onSeatRequestSubmitted 成员account提交了位置为seatIndex的麦位申请。
onSeatRequestCancelled 成员account取消了位置为seatIndex的麦位申请。
onSeatRequestApproved 管理员通过了成员account的麦位申请,位置为seatIndex
onSeatRequestRejected 管理员拒绝了成员account的麦位申请,位置为seatIndex
onSeatLeave 成员下麦,位置为seatIndex
onSeatKicked 成员accountoperateBy从位置为seatIndex的麦位踢掉。
onSeatListChanged 麦位变更通知。
onSongListChanged() 已点列表的更新
onSongOrdered 点歌
onSongDeleted 已点列表的删除
onSongTopped 已点列表的置顶
onNextSong 下一首歌
onSongPlayingPosition 当前歌曲播放进度
onRecordingAudioFrame Rtc audioFrame数据回调
onSongPlayingCompleted() 播放完成