123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //
- // YMRecordSoundView.h
- // MSYOUPAI
- //
- // Created by YoMi on 2024/2/25.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- NS_ASSUME_NONNULL_BEGIN
- /// 录制音频状态
- typedef NS_ENUM(NSUInteger,YMRecordSoundStatusType) {
- YMRecordSoundStatusTypeNone = 0, /// 未开始
- YMRecordSoundStatusTypeStart, /// 已开始
- YMRecordSoundStatusTypeFinish, /// 已完成
- YMRecordSoundStatusTypePlay, /// 播放
- YMRecordSoundStatusTypeSubmit, /// 提交
- };
- /// 录制音频导出类型
- typedef NS_ENUM(NSUInteger,YMRecordSoundExportType) {
- YMRecordSoundExportTypePM3 = 0, /// mp3
- YMRecordSoundExportTypeAAC, /// aac
- };
- typedef void(^RecordSoundExportUrlBlock)(NSURL * _Nonnull voiceUrl, NSInteger voiceDuration);
- @interface YMRecordSoundView : UIView
- - (instancetype)initWithIsNeedSubmitButton:(BOOL)isNeedSubmitButton OperationSize:(CGSize)operationSize;
- /// 录制声音导出路径回调
- @property (nonatomic, copy) RecordSoundExportUrlBlock exportUrlBlock;
- /// 最少时长
- @property (nonatomic, assign) NSInteger minDuration;
- /// 最大时长
- @property (nonatomic, assign) NSInteger maxDuration;
- /// 重录背景色
- @property (nonatomic, strong) UIColor *rerecordBgColor;
- /// 提交背景色
- @property (nonatomic, strong) UIColor *submitBgColor;
- /// 重录标题颜色
- @property (nonatomic, strong) UIColor *rerecordTitleColor;
- /// 提交标题颜色
- @property (nonatomic, strong) UIColor *submitTitleColor;
- /// 重录字体样式大小
- @property (nonatomic, strong) UIFont *rerecordFont;
- /// 提交字体样式大小
- @property (nonatomic, strong) UIFont *submitFont;
- /// 重录标题
- @property (nonatomic, copy) NSString *rerecordTitle;
- /// 提交标题
- @property (nonatomic, copy) NSString *submitTitle;
- /// 重录圆角大小
- @property (nonatomic, assign) CGFloat rerecordRadius;
- /// 提交圆角大小
- @property (nonatomic, assign) CGFloat submitRadius;
- /// 重录边框色
- @property (nonatomic, assign) UIColor *rerecordBorderColor;
- /// 提交边框色
- @property (nonatomic, assign) UIColor *submitBorderColor;
- /// 重录边框宽度大小
- @property (nonatomic, assign) CGFloat rerecordBorderWidth;
- /// 提交边框宽度大小
- @property (nonatomic, assign) CGFloat submitBorderWidth;
- /// 重录图片
- @property (nonatomic, strong) NSString *rerecordImageStr;
- /// 提交图片
- @property (nonatomic, strong) NSString *submitImageStr;
- /// 需要转出的文件格式
- @property (nonatomic, assign) YMRecordSoundExportType exportType;
- /// 本地url路径
- - (NSURL *)recordAudioUrl;
- /// 获取提交声音url
- - (NSURL *)getSubmitSoundUrl;
- /// 停止录制
- - (void)stopRecord;
- @end
- NS_ASSUME_NONNULL_END
|