// // AudioEnginePlayer.h // KulexiuForStudent // // Created by 王智 on 2024/6/4. // #import @class AudioEnginePlayer; @protocol AudioEnginePlayerDelegate - (void)updatePlayProgress:(NSInteger)playTime andTotalTime:(NSInteger)totalTime andProgress:(CGFloat)progress currentInterval:(NSTimeInterval)currentInterval inPlayer:(AudioEnginePlayer *_Nonnull)player; @optional - (void)enginePlayFinished:(AudioEnginePlayer *_Nonnull)player; - (void)enginePlayerIsReadyPlay:(AudioEnginePlayer *_Nonnull)player; - (void)enginePlayerDidError:(AudioEnginePlayer *_Nonnull)player error:(NSError *_Nonnull)error; @end NS_ASSUME_NONNULL_BEGIN @interface AudioEnginePlayer : NSObject @property (nonatomic, weak) id delegate; @property (nonatomic, assign) float rate; // 播放速度 @property (nonatomic, assign) BOOL isReady; @property (nonatomic, assign) BOOL isPlaying; @property (nonatomic, assign) BOOL isMute; // 是否禁音 - (void)prepareNativeSongWithUrl:(NSURL *)nativeMusicUrl; - (void)startPlay; - (void)stopPlay; - (void)freePlayer; // 从某个位置开始播放 ms - (void)seekToTimePlay:(NSInteger)time; - (NSTimeInterval)getCurrentPlayTime; @end NS_ASSUME_NONNULL_END