Platforms to show: All Mac Windows Linux Cross-Platform
AVAudioRecorderMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Using an audio recorder you can:
- Record until the user stops the recording
- Record for a specified duration
- Pause and resume a recording
- Obtain input audio-level data that you can use to provide level metering
In OS X, the audio comes from the system's default audio input device as set by a user in System Preferences.
You can implement a subclass of AVFoundationMBS to respond to audio interruptions and audio decoding errors, and to the completion of a recording.
To configure a recording, including options such as bit depth, bit rate, and sample rate conversion quality, configure the audio recorder's settings dictionary. Use the settings keys described in AV Foundation Audio Settings Constants.
To configure an appropriate audio session for recording, refer to AVAudioSession Class Reference and AVAudioSessionDelegate Protocol Reference.
The AVAudioRecorder class is intended to allow you to make audio recordings with very little programming overhead. Other classes that can be used for recording audio in OS X include AVCaptureAudioDataOutput and the Audio Queue services described in the Audio Queue Services Programming Guide.
In OS X, you can also use the AVCaptureAudioFileOutput class to record audio.
Available in OS X v10.7 and later.
Calls audioRecorderEncodeErrorDidOccur and audioRecorderDidFinishRecording events on AVFoundationMBS class.
- 2 properties
- property Handle as Integer
- property MeteringEnabled as boolean
- 15 methods
- method averagePowerForChannel(channelNumber as Integer) as Double
- method Constructor(file as folderitem, settings as Dictionary, byref error as NSErrorMBS)
- method Constructor(URL as string, settings as Dictionary, byref error as NSErrorMBS)
- method currentTime as Double
- method deleteRecording as boolean
- method pause
- method peakPowerForChannel(channelNumber as Integer) as Double
- method prepareToRecord as boolean
- method record as boolean
- method recordForDuration(duration as Double) as boolean
- method Recording as boolean
- method settings as Dictionary
- method stop
- method updateMeters
- method url as string
- shared method available as boolean
This class has no sub classes.
Some events using this class:
- AVFoundationMBS.audioRecorderDidFinishRecording(recorder as AVAudioRecorderMBS, successful as boolean)
- AVFoundationMBS.audioRecorderEncodeErrorDidOccur(recorder as AVAudioRecorderMBS, error as NSErrorMBS)
Some examples using this class:
The items on this page are in the following plugins: MBS AVFoundation Plugin.
AVAudioPlayerNodeMBS - AVAudioTimeMBS