| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // JCHATAudioPlayerHelper.h
- // MessageDisplayKit
- //
- // Created by Aevitx on 14-1-22.
- // Copyright (c) 2014年 Aevitx. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <AVFoundation/AVAudioPlayer.h>
- #import "XHMacro.h"
- @protocol XHAudioPlayerHelperDelegate <NSObject>
- @optional
- - (void)didAudioPlayerBeginPlay:(AVAudioPlayer*)audioPlayer;
- - (void)didAudioPlayerStopPlay:(AVAudioPlayer*)audioPlayer;
- - (void)didAudioPlayerPausePlay:(AVAudioPlayer*)audioPlayer;
- @end
- @interface JCHATAudioPlayerHelper : NSObject <AVAudioPlayerDelegate>
- @property (nonatomic, strong) AVAudioPlayer *player;
- @property (nonatomic, copy) NSString *playingFileName;
- @property (nonatomic, assign) id <XHAudioPlayerHelperDelegate> delegate;
- @property (nonatomic, strong) NSIndexPath *playingIndexPathInFeedList;//给动态列表用
- + (id)shareInstance;
- - (AVAudioPlayer*)player;
- - (BOOL)isPlaying;
- - (void)managerAudioWithFileName:(NSString*)amrName toPlay:(BOOL)toPlay;
- - (void)managerAudioWithData:(NSData *)data toplay:(BOOL)toPlay;
- - (void)pausePlayingAudio;//暂停
- - (void)stopAudio;//停止
- @end
|