Files
keyboard/keyBoard/Class/AiTalk/V/KBAiWaveformView.h
2026-02-02 19:07:00 +08:00

47 lines
954 B
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.

//
// KBAiWaveformView.h
// keyBoard
//
// Created by Mac on 2026/1/15.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 波形动画视图
/// 根据音量 RMS 值实时显示波形动画
@interface KBAiWaveformView : UIView
/// 波形颜色
@property(nonatomic, strong) UIColor *waveColor;
/// 波形条数量
@property(nonatomic, assign) NSInteger barCount;
/// 波形条宽度
@property(nonatomic, assign) CGFloat barWidth;
/// 波形条间距
@property(nonatomic, assign) CGFloat barSpacing;
/// 自定义柱状高度基准0~1长度需 >= barCount未设置则使用默认算法
@property(nonatomic, strong, nullable) NSArray<NSNumber *> *barHeightPattern;
/// 更新音量值
/// @param rms 音量 RMS 值 (0.0 - 1.0)
- (void)updateWithRMS:(float)rms;
/// 开始动画(空闲波动)
- (void)startIdleAnimation;
/// 停止动画
- (void)stopAnimation;
/// 重置波形
- (void)reset;
@end
NS_ASSUME_NONNULL_END