Skip to content

Commit

Permalink
Merge pull request #175 from syedhali/audioplayer_w_output_rewrite
Browse files Browse the repository at this point in the history
Rewrote EZAudioPlayer using EZOutput
  • Loading branch information
syedhali committed Jun 30, 2015
2 parents ab9fb5b + 33bdcee commit 3ae090c
Show file tree
Hide file tree
Showing 12 changed files with 918 additions and 492 deletions.
2 changes: 1 addition & 1 deletion EZAudio/EZAudioFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ typedef void (^EZAudioWaveformDataCompletionBlock)(float **waveformData, int len
/**
The EZAudioFile provides a lightweight and intuitive way to asynchronously interact with audio files. These interactions included reading audio data, seeking within an audio file, getting information about the file, and pulling the waveform data for visualizing the contents of the audio file. The EZAudioFileDelegate provides event callbacks for when reads, seeks, and various updates happen within the audio file to allow the caller to interact with the action in meaningful ways. Common use cases here could be to read the audio file's data as AudioBufferList structures for output (see EZOutput) and visualizing the audio file's data as a float array using an audio plot (see EZAudioPlot).
*/
@interface EZAudioFile : NSObject
@interface EZAudioFile : NSObject <NSCopying>

//------------------------------------------------------------------------------
#pragma mark - Properties
Expand Down
32 changes: 32 additions & 0 deletions EZAudio/EZAudioFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ + (instancetype)audioFileWithURL:(NSURL *)url
clientFormat:clientFormat];
}

//------------------------------------------------------------------------------
#pragma mark - NSCopying
//------------------------------------------------------------------------------

- (id)copyWithZone:(NSZone *)zone
{
return [EZAudioFile audioFileWithURL:self.url];
}

//------------------------------------------------------------------------------
#pragma mark - Class Methods
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -667,6 +676,29 @@ - (void)setCurrentTime:(NSTimeInterval)currentTime
[self seekToFrame:frame];
}

//------------------------------------------------------------------------------
#pragma mark - Description
//------------------------------------------------------------------------------

- (NSString *)description
{
return [NSString stringWithFormat:@"%@ {\n"
" url: %@,\n"
" duration: %f,\n"
" totalFrames: %lld,\n"
" metadata: %@,\n"
" fileFormat: { %@ },\n"
" clientFormat: { %@ } \n"
"}",
[super description],
[self url],
[self duration],
[self totalFrames],
[self metadata],
[EZAudioUtilities stringForAudioStreamBasicDescription:[self fileFormat]],
[EZAudioUtilities stringForAudioStreamBasicDescription:[self clientFormat]]];
}

//------------------------------------------------------------------------------

@end
309 changes: 211 additions & 98 deletions EZAudio/EZAudioPlayer.h

Large diffs are not rendered by default.

Loading

0 comments on commit 3ae090c

Please sign in to comment.