Files
peko-ios/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h
2024-10-17 16:05:02 +08:00

74 lines
1.9 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// XPSkillCardPlayerManager.h
// YuMi
//
// Created by GreenLand on 2022/3/9.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
typedef enum : NSUInteger {
MICState_None = 0,
MICState_Open = 1,
MICState_Close = 2,
MICState_Music = 3,
} MICState;
@interface XPSkillCardPlayerManager : NSObject
////获取已解锁照片id列表
@property(nonatomic,strong) NSMutableArray *photoIdList;
///播放器
@property (nonatomic, strong) AVAudioPlayer *player;
///是否正在播放
@property (nonatomic,assign) BOOL isPlay;
///播放音量大小
@property (nonatomic, assign) CGFloat volume;
@property (nonatomic,assign) BOOL isInRoomFirstRecharge;
///是否在房间
@property (nonatomic,assign) BOOL isInRoom;
///是否在房间控制器里,用于播放动画的判断
@property (nonatomic,assign) BOOL isInRoomVC;
///是否在首充不弹出界面
///所在房间的id
@property (nonatomic,copy) NSString *roomUid;
///我是否在上麦,在麦上时不能录音
@property (nonatomic,assign) BOOL isMineInMic;
// 用户在 mic 的状态
@property (nonatomic, assign) MICState micState;
+ (instancetype)shareInstance ;
/**
播放一次音频
@param filePath 本地路径
@param completionBlock 播放完成回调
*/
- (void)playerVoiceWithPath:(NSString *)filePath completionBlock:(void (^)(void))completionBlock;
/**
新的播放一次音频
@param filePath 本地路径
@param completionBlock 播放完成回调
*/
- (void)playerNewVoiceWithPath:(NSString *)filePath completionBlock:(void (^)(void))completionBlock;
/**
停止音乐
*/
- (void)stopMusic;
/**
停止音乐 是否需要执行完成回调更新UI
*/
- (void)stopMusicIsNeedCompletion:(BOOL)isNeedCompletion;
///关闭麦克风、听筒
- (void)closeMicroAndVoiceWithBroadcast:(BOOL)isBroadcast;
///恢复之前的 麦克风、听筒听筒状态
- (void)recoverMicroAndVoiceWithBroadcast:(BOOL)isBroadcast;
@end