<commit_before>//
//  AFSoundManager.h
//  AFSoundManager-Demo
//
//  Created by <NAME> on 4/16/14.
//  Copyright (c) 2014 AlvaroFranco. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import <objc/runtime.h>

#import "AFAudioRouter.h"

typedef NS_ENUM (int, AFSoundManagerStatus) {
    AFSoundManagerStatusPlaying,
    AFSoundManagerStatusPaused,
    AFSoundManagerStatusStopped,
    AFSoundManagerStatusRestarted,
    AFSoundManagerStatusFinished
};

@class AFSoundManager;

@protocol AFSoundManagerDelegate

-(void)currentPlayingStatusChanged:(AFSoundManagerStatus)status;

@end

@interface AFSoundManager : NSObject

typedef void (^progressBlock)(int percentage, CGFloat elapsedTime, CGFloat timeRemaining, NSError *error, BOOL finished);

+(instancetype)sharedManager;
@property (nonatomic, assign) id<AFSoundManagerDelegate> delegate;

@property (nonatomic, strong) AVAudioPlayer *audioPlayer;
@property (nonatomic, strong) AVPlayer *player;
@property (nonatomic, strong) AVAudioRecorder *recorder;
@property (nonatomic, strong) AVQueuePlayer *queuePlayer;

@property (nonatomic) int status;

<<<<<<< HEAD
-(void)startPlayingLocalFileWithName:(NSString *)name atPath:(NSString *)path withCompletionBlock:(progressBlock)block;
=======
-(void)startPlayingLocalFilePath:(NSString *)filePath andBlock:(progressBlock)block;
-(void)startPlayingLocalFileWithName:(NSString *)name andBlock:(progressBlock)block;
-(void)startPlayingLocalFileWithURL:(NSURL *)fileURL andBlock:(progressBlock)block;
>>>>>>> 013d76c2d1803ac3a124f64329a41b6f0dd04ba0
-(void)startStreamingRemoteAudioFromURL:(NSString *)url andBlock:(progressBlock)block;

-(void)pause;
-(void)resume;
-(void)stop;
-(void)restart;

-(BOOL)status:(AFSoundManagerStatus)status;

-(void)changeVolumeToValue:(CGFloat)volume;
-(void)changeSpeedToRate:(CGFloat)rate;
-(void)moveToSecond:(int)second;
-(void)moveToSection:(CGFloat)section;
-(NSDictionary *)retrieveInfoForCurrentPlaying;

-(void)startRecordingAudioWithFileName:(NSString *)name andExtension:(NSString *)extension shouldStopAtSecond:(NSTimeInterval)second;
-(void)pauseRecording;
-(void)resumeRecording;<commit_msg>Updates main header to fix git weirdness<commit_after>//
//  AFSoundManager.h
//  AFSoundManager-Demo
//
//  Created by <NAME> on 4/16/14.
//  Copyright (c) 2014 AlvaroFranco. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import <objc/runtime.h>

#import "AFAudioRouter.h"

typedef NS_ENUM (int, AFSoundManagerStatus) {
    AFSoundManagerStatusPlaying,
    AFSoundManagerStatusPaused,
    AFSoundManagerStatusStopped,
    AFSoundManagerStatusRestarted,
    AFSoundManagerStatusFinished
};

@class AFSoundManager;

@protocol AFSoundManagerDelegate

-(void)currentPlayingStatusChanged:(AFSoundManagerStatus)status;

@end

@interface AFSoundManager : NSObject

typedef void (^progressBlock)(int percentage, CGFloat elapsedTime, CGFloat timeRemaining, NSError *error, BOOL finished);

+(instancetype)sharedManager;
@property (nonatomic, assign) id<AFSoundManagerDelegate> delegate;

@property (nonatomic, strong) AVAudioPlayer *audioPlayer;
@property (nonatomic, strong) AVPlayer *player;
@property (nonatomic, strong) AVAudioRecorder *recorder;
@property (nonatomic, strong) AVQueuePlayer *queuePlayer;

@property (nonatomic) int status;

-(void)startPlayingLocalFileWithName:(NSString *)name atPath:(NSString *)path withCompletionBlock:(progressBlock)block;
-(void)startStreamingRemoteAudioFromURL:(NSString *)url andBlock:(progressBlock)block;

-(void)pause;
-(void)resume;
-(void)stop;
-(void)restart;

-(BOOL)status:(AFSoundManagerStatus)status;

-(void)changeVolumeToValue:(CGFloat)volume;
-(void)changeSpeedToRate:(CGFloat)rate;
-(void)moveToSecond:(int)second;
-(void)moveToSection:(CGFloat)section;
-(NSDictionary *)retrieveInfoForCurrentPlaying;

-(void)startRecordingAudioWithFileName:(NSString *)name andExtension:(NSString *)extension shouldStopAtSecond:(NSTimeInterval)second;
-(void)pauseRecording;
-(void)resumeRecording;
{'fraction_non_alphanumeric': 0.12431791221826809, 'fraction_numerical': 0.01043890865954923, 'mean_word_length': 8.495495495495495, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6476851', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1317, 'n_words': 242}