Skip to content

Drop-in class to record audio note in iOS application and get it back in the app.

License

Notifications You must be signed in to change notification settings

smolskyaleksey/PMAudioRecorderViewController

 
 

Repository files navigation

PMAudioRecorderViewController

Drop-in class to record audio note in iOS application and get it back in the app.

Usage

Instalation:

pod 'PMAudioRecorderViewController'

or drop the contents of AudioNoteRecorderViewController directory in your Xcode project.

In the code:

#import "AudioRecorderViewController"
...
[AudioNoteRecorderViewController showRecorderMasterViewController:self withFinishedBlock:^(BOOL wasRecordingTaken, NSURL *recordingURL) {
    if (wasRecordingTaken) {
        // do whatever you want with that URL to the .caf file
    }
}];

Or, to have it more customisable:

NSDictionary *recorderSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                            [NSNumber numberWithInt:kAudioFormatAppleIMA4],AVFormatIDKey,
                            [NSNumber numberWithInt:44100],AVSampleRateKey, 
                            [NSNumber numberWithInt:1],AVNumberOfChannelsKey,
                            [NSNumber numberWithInt:16],AVLinearPCMBitDepthKey,
                            [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey, 
                            [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey,
                            nil];

[AudioNoteRecorderViewController showRecorderMasterViewController:self 
                                            withRecorderSettings:recorderSettings
                                            withFileExtension:@"caf"
                                            withFinishedBlock:^(BOOL wasRecordingTaken, NSURL *recordingURL) {
    if (wasRecordingTaken) {
        // do whatever you want with that URL to the .caf file
    }
}];

Author

(C) Paweł Mączewski, [email protected], Twitter: http://twitter.com/pawelmaczewski.

About

Drop-in class to record audio note in iOS application and get it back in the app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.1%
  • Ruby 2.9%