//
|
// CSAudioManager.h
|
// MusicVideos
|
//
|
// Created by iOS_Chris on 16/8/8.
|
// Copyright © 2016年 kyExpress. All rights reserved.
|
//
|
|
#import <Foundation/Foundation.h>
|
#import <AVFoundation/AVFoundation.h>
|
|
typedef void(^BlockPlayerDidFinishPlaying)(void);
|
typedef void(^BlockPlayerStartPlay)(void);
|
typedef void(^BlockPlayerStopPlay)(void);
|
|
@interface CSAudioManager : NSObject
|
|
|
@property (nonatomic,copy) BlockPlayerDidFinishPlaying blockPlayerDidFinishPlaying;
|
@property (nonatomic,copy) BlockPlayerStartPlay blockPlayerStartPlay;
|
@property (nonatomic,copy) BlockPlayerStopPlay blockPlayerStopPlay;
|
|
//获取播放语音唯一标识 - 防止音频修改后UniqueID没有变
|
//+ (NSString *)getPlayIDWithNoticeRecieveModel:(NoticeRecieveModel *)nrModel;
|
|
-(void)setBlockPlayerStopPlay:(BlockPlayerStopPlay)blockPlayerStopPlay;
|
-(void)setBlockPlayerStartPlay:(BlockPlayerStartPlay)blockPlayerStartPlay;
|
-(void)setBlockPlayerDidFinishPlaying:(BlockPlayerDidFinishPlaying)blockPlayerDidFinishPlaying;
|
|
+ (instancetype)defaultManager;
|
//播放音乐
|
//- (AVAudioPlayer *)playingMusicCacheWithPlayID:(NSString *)playID;
|
- (AVAudioPlayer *)playingMusicWithURL:(NSURL *)url playID:(NSString *)playID;
|
- (AVAudioPlayer *)playingMusicWithData:(NSData *)musicData playID:(NSString *)playID;
|
|
- (void)pauseMusicWithPlayID:(NSString *)playID;
|
- (void)stopMusicWithPlayID:(NSString *)playID;
|
|
//是否有缓存
|
//- (BOOL)isHavePlayerCacheWithPlayID:(NSString *)playID;
|
|
//播放音效
|
- (void)playSoundWithSoundName:(NSString *)soundName PlayID:(NSString *)playID;
|
//摧毁音效
|
- (void)disposeSoundWithPlayID:(NSString *)playID;
|
- (void)stopAllMusic;
|
- (BOOL)isPlayingWithPlayID:(NSString *)playID;
|
@end
|