// // YMAudioPlayer.h // MSYOUPAI // // Created by YoMi on 2024/2/25. // Copyright © 2024 MS. All rights reserved. // #import #import "FSAudioStream.h" #define kAudioPlayer [YMAudioPlayer sharedInstance] @class YMAudioPlayer; @protocol YMAudioPlayerDelegate @optional - (void)audioPlayerDidPlayMusicCompleted; - (void)audioPlayer:(YMAudioPlayer *)player stateChangeWithState:(FSAudioStreamState)state; @end @interface YMAudioPlayer : NSObject + (instancetype)sharedInstance; /** 代理 */ @property (nonatomic, weak) id delegate; /** 播放地址 */ @property (nonatomic, copy) NSString *playUrlStr; /** 播放状态 */ @property (nonatomic, readonly) FSAudioStreamState state; /** 播放进度 */ @property (nonatomic, assign) float progress; /** AudioStream 播放器 */ @property (nonatomic, strong) FSAudioStream *audioStream; /** 播放 */ - (void)play; /** 暂停 */ - (void)pause; /** 恢复播放 */ - (void)resume; /** 停止播放 */ - (void)stop; @end