Avaudiorecorder Recording Processing

Source: Internet
Author: User
Tags file url

The Avaudiorecorder class is dedicated to handling recording operations and can provide audio recording capabilities in your application. Recordings can only be saved to local files. It is included in the Avfoundation Framework library.

The following are common properties and methods:

Property Description
@property (readonly, getter=isrecording) BOOL recording Whether audio is being recorded (read-only)
@property (readonly) Nsurl *url Audio file path (read only)
@property (nonatomic, copy) Nsarray *channelassignments An array of Avaudiosessionchanneldescription objects associated with the recorder
@property (readonly) Nstimeinterval currenttime Recording duration (read only), can only be used when recording, when the recording stops, straight to 0
@property (readonly) Nstimeinterval Devicecurrenttime Enter the length of the setting, read-only, and note that this property is accessible all the time
@property (readonly) nsdictionary *settings Audio settings for audio recorders. (Read only)
@property (getter=ismeteringenabled) BOOL meteringenabled Whether to enable recording measurement, if you enable recording measurement can obtain data such as decibel recording
Method Description
-(Instancetype) Initwithurl: (nsurl *) URL settings: (nsdictionary *) settings error: (Nserror *) outerror How to initialize the Sound Recorder object, the URL must be a local file URL
-(BOOL) Preparetorecord Preparing recordings, primarily for creating caches
-(BOOL) record Start recording
-(BOOL) Recordattime: (nstimeinterval) time Start recording at a specified time,
-(BOOL) Recordforduration: (nstimeinterval) duration Start recording according to the specified length of time
-(BOOL) Recordattime: (nstimeinterval) Time forduration: (nstimeinterval) duration Start recording at a specified time and specify the length of the recording
-(void) Pause Pause Recording
-(void) stop Stop Recording
-(BOOL) deleterecording Delete the recording, note that the recorder must be in a stopped state at this time
Proxy method Description
-(void) audiorecorderdidfinishrecording: (Avaudiorecorder *) Recorder successfully: (BOOL) flag End of recording
-(void) Audiorecorderencodeerrordidoccur: (Avaudiorecorder *) Recorder error: (NSERROR *) error Audio Codec error occurred

When you create a sound recorder, you must specify the recording settings information in addition to the path, because the recorder must know the format of the recording file, the sample rate, the number of channels, and so on.

Avaudiorecorder Recording Processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.