练歌房
This commit is contained in:
@@ -31,6 +31,9 @@
|
||||
@property (nonatomic , strong)RPSystemBroadcastPickerView *systemBroadcastPicker;
|
||||
@property (nonatomic , strong)AgoraRtcChannelMediaOptions *option;
|
||||
@property (nonatomic , assign) BOOL isOpenMic;
|
||||
@property(nonatomic, assign) double renshengRatio;
|
||||
@property(nonatomic, assign) double playerRatio;
|
||||
@property (nonatomic, assign)AgoraAudioEffectPreset currentVoiceStyle;
|
||||
@end
|
||||
|
||||
@implementation QXAgoraEngine
|
||||
@@ -51,6 +54,9 @@
|
||||
|
||||
//初始化
|
||||
- (void)initializeAgoraEngine {
|
||||
self.renshengRatio = 0.5;
|
||||
self.playerRatio = 0.5;
|
||||
self.currentVoiceStyle = AgoraAudioEffectPresetOff;
|
||||
self.agoraKit = [AgoraRtcEngineKit sharedEngineWithAppId:AgoraAuthId delegate:self];
|
||||
[self.agoraKit enableAudioVolumeIndication:200 smooth:3 reportVad:NO];
|
||||
[self.agoraKit getCurrentMonotonicTimeInMs];
|
||||
@@ -503,7 +509,7 @@
|
||||
|
||||
//创建音乐播放器。如果你需要播放音乐内容中心的音乐资源,需要使用此播放器进行播放。
|
||||
_ktvPlayer = [_ktvAmcc createMusicPlayerWithDelegate:self];
|
||||
|
||||
[self ktv_resetVoice];
|
||||
}
|
||||
|
||||
- (void)ktv_DestoryKtvPlayer{
|
||||
@@ -706,24 +712,32 @@
|
||||
|
||||
|
||||
-(void)ktv_SetRenshengVolume:(float)ratio {
|
||||
int volume = ratio*400;
|
||||
self.renshengVolume = volume;
|
||||
int volume = ratio*200;
|
||||
self.renshengRatio = ratio;
|
||||
// if (self.useMicrophone) {
|
||||
[self.agoraKit adjustRecordingSignalVolume:volume];
|
||||
// }
|
||||
}
|
||||
-(void)ktv_SetBanzouVolume:(float)ratio {
|
||||
int volume = ratio*100;
|
||||
int volume = ratio*200;
|
||||
self.playerRatio = ratio;
|
||||
[self.ktvPlayer adjustPlayoutVolume:volume];
|
||||
[self.ktvPlayer adjustPublishSignalVolume:volume];
|
||||
[self.ktvPlayer adjustPublishSignalVolume:volume/2];
|
||||
}
|
||||
-(float)ktv_GetBanzouVolume {
|
||||
int volume = [self.ktvPlayer getPlayoutVolume];
|
||||
// [self.agoraKit getAudioMixingPlayoutVolume];
|
||||
return volume/100.0;
|
||||
}
|
||||
|
||||
|
||||
-(int)ktv_setAudioEffectPreset:(AgoraAudioEffectPreset)prese{
|
||||
self.currentVoiceStyle = prese;
|
||||
return [[QXAgoraEngine sharedEngine].agoraKit setAudioEffectPreset:prese];
|
||||
}
|
||||
-(void)ktv_resetVoice{
|
||||
[self ktv_SetRenshengVolume:0.5];
|
||||
[self ktv_SetBanzouVolume:0.5];
|
||||
[self ktv_setAudioEffectPreset:AgoraAudioEffectPresetOff];
|
||||
}
|
||||
-(NSMutableArray *)bgMusicArray{
|
||||
if (!_bgMusicArray) {
|
||||
_bgMusicArray = [NSMutableArray array];
|
||||
|
||||
Reference in New Issue
Block a user