练歌房
This commit is contained in:
@@ -63,7 +63,12 @@ typedef void(^SearchSongBlock)(NSArray<AgoraMusic *> *songList,BOOL isReload);
|
||||
@property (nonatomic, strong) id<AgoraMusicPlayerProtocol> ktvPlayer;
|
||||
@property(nonatomic, assign) NSInteger playPosition;//播放进度
|
||||
@property(nonatomic, assign) BOOL isErfan;
|
||||
@property(nonatomic, assign) NSInteger renshengVolume;//采集音量,取值范围为 [0,400],默认100
|
||||
|
||||
/// 下面三个属性为k歌房使用
|
||||
@property(nonatomic, assign,readonly) double renshengRatio;//采集音量,取值范围为 [0,400],默认100
|
||||
@property(nonatomic, assign,readonly) double playerRatio;//采集音量,取值范围为 [0,400],默认100
|
||||
//播放音效
|
||||
@property (nonatomic, assign,readonly)AgoraAudioEffectPreset currentVoiceStyle;
|
||||
@property(nonatomic, assign) BOOL useMicrophone;
|
||||
|
||||
/// 当前是否为开麦状态
|
||||
@@ -182,9 +187,10 @@ typedef void(^SearchSongBlock)(NSArray<AgoraMusic *> *songList,BOOL isReload);
|
||||
- (void)setLocalVoiceReverbKTV;
|
||||
//设置录音棚
|
||||
- (void)setLocalVoiceReverbRecordingStudio;
|
||||
//播放音效
|
||||
@property (nonatomic, assign)NSInteger CurrentVoiceStyle;
|
||||
|
||||
/// 设置音色
|
||||
- (int)ktv_setAudioEffectPreset:(AgoraAudioEffectPreset)prese;
|
||||
/// 重置ktv声音及伴奏
|
||||
- (void)ktv_resetVoice;
|
||||
|
||||
|
||||
-(void)startScreenCapture;
|
||||
|
||||
@@ -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