Objective-C AVAudioRecorder SDK 3.0

July 6, 2009 § Leave a comment

AVAudioRecorder class is only available on OS3.0.

// Properties
@property (readonly) NSTimeInterval currentTime;

@property (assign) id <AVAudioRecorderDelegate> delegate;

@property (getter=isMeteringEnabled) BOOL meteringEnabled;

@property (readonly, getter=isRecording) BOOL recording;

@property (readonly) NSDictionary *settings;

@property (readonly) NSURL *url;

// Returns the average power for a given channel, in decibels, for the sound being recorded
– (float)averagePowerForChannel:(NSUInteger)channelNumber

// Deletes a recorded audio file
– (BOOL)deleteRecording

// Initializes and returns an audio recorder
– (id)initWithURL:(NSURL *)url settings:(NSDictionary *)settings error:(NSError **)outError

// Pauses a recording
– (void)pause

// Returns the peak power for a given channel, in decibels, for the sound being recorded
– (float)peakPowerForChannel:(NSUInteger)channelNumber

// Creates an audio file and prepares the system for recording
– (BOOL)prepareToRecord

// Starts or resumes recording
– (BOOL)record

// Records for a specified duration of time
– (BOOL)recordForDuration:(NSTimeInterval)duration

// Stops recording and closes the audio file
– (void)stop

// Refreshes the average and peak power values for all channels of an audio recorder
– (void)updateMeters

Audio Format Settings

NSString *const AVFormatIDKey;
NSString *const AVSampleRateKey;
NSString *const AVNumberOfChannelsKey;

AVFormatIDKey
A format identifier.

AVSampleRateKey
A sample rate, in hertz, expressed as an NSNumber floating point value.

AVNumberOfChannelsKey
The number of channels expressed as an NSNumber integer value.

Linear PCM Format Settings

NSString *const AVLinearPCMBitDepthKey;
NSString *const AVLinearPCMIsBigEndianKey;
NSString *const AVLinearPCMIsFloatKey;

AVLinearPCMBitDepthKey
An NSNumber integer that indicates the bit depth for a linear PCM audio format—one of 8, 16, 24, or 32.

AVLinearPCMIsBigEndianKey
A Boolean value that indicates whether the audio format is big endian (YES) or little endian (NO).

AVLinearPCMIsFloatKey
A Boolean value that indicates that the audio format is floating point (YES) or fixed point (NO).

Audio Encoder Settings

NSString *const AVEncoderAudioQualityKey;
NSString *const AVEncoderBitRateKey;
NSString *const AVEncoderBitDepthHintKey;

Sample Rate Conversion Settings

NSString *const AVSampleRateConverterAudioQualityKey;

Audio Quality Flags

Keys that specify sample rate conversion quality, used for the AVSampleRateConverterAudioQualityKey property.

enum {
AVAudioQualityMin = 0,
AVAudioQualityLow = 0x20,
AVAudioQualityMedium = 0x40,
AVAudioQualityHigh = 0x60,
AVAudioQualityMax = 0x7F
};
typedef NSInteger AVAudioQuality;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Objective-C AVAudioRecorder SDK 3.0 at Web Builders.

meta

%d bloggers like this: