Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVAudioRecorderMBS class.

AVAudioRecorderMBS.averagePowerForChannel(channelNumber as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the average power for a given channel, in decibels, for the sound being recorded.

channelNumber: The number of the channel that you want the average power value for.
Returns the current average power, in decibels, for the sound being recorded. A return value of 0 dB indicates full scale, or maximum power; a return value of -160 dB indicates minimum power (that is, near silence).

If the signal provided to the audio recorder exceeds ±full scale, then the return value may exceed 0 (that is, it may enter the positive range).

To obtain a current average power value, you must call the updateMeters method before calling this method.

AVAudioRecorderMBS.Constructor(file as folderitem, settings as Dictionary, byref error as NSErrorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an audio recorder.

url: The file system location to record to. The file type to record to is inferred from the file extension included in this parameter's value.
settings: Settings for the recording session. For information on the settings available for an audio recorder, see AV Foundation Audio Settings Constants.
Error: Pass in the address of a nil-initialized NSError object. If an error occurs, upon return the NSError object describes the error. If you do not want error information, pass in NULL.

See also:

AVAudioRecorderMBS.Constructor(URL as string, settings as Dictionary, byref error as NSErrorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes an audio recorder.

url: The file system location to record to. The file type to record to is inferred from the file extension included in this parameter's value.
settings: Settings for the recording session. For information on the settings available for an audio recorder, see AV Foundation Audio Settings Constants.
Error: Pass in the address of a nil-initialized NSError object. If an error occurs, upon return the NSError object describes the error. If you do not want error information, pass in NULL.

See also:

AVAudioRecorderMBS.currentTime as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The time, in seconds, since the beginning of the recording. (read-only)

When the audio recorder is stopped, calling this method returns a value of 0.
Available in OS X v10.7 and later.

AVAudioRecorderMBS.deleteRecording as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Deletes a recorded audio file.

Returns true on success, or false on failure.
The audio recorder must be stopped before you call this method.

AVAudioRecorderMBS.MeteringEnabled as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
A Boolean value that indicates whether audio-level metering is enabled (true), or not (false).

By default, audio level metering is off for an audio recorder. Because metering uses computing resources, turn it on only if you intend to use it.
Available in OS X v10.7 and later.
(Read and Write computed property)

AVAudioRecorderMBS.pause

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Pauses a recording.

Call record to resume recording.

AVAudioRecorderMBS.peakPowerForChannel(channelNumber as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the peak power for a given channel, in decibels, for the sound being recorded.

channelNumber: The number of the channel that you want the peak power value for.

Returns the current peak power, in decibels, for the sound being recorded. A return value of 0 dB indicates full scale, or maximum power; a return value of -160 dB indicates minimum power (that is, near silence).

If the signal provided to the audio recorder exceeds ±full scale, then the return value may exceed 0 (that is, it may enter the positive range).

To obtain a current peak power value, call the updateMeters method immediately before calling this method.

AVAudioRecorderMBS.prepareToRecord as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an audio file and prepares the system for recording.

Returns true on success, or false on failure.

Creates an audio file at the location specified by the url parameter in the Constructor method. If a file already exists at that location, this method overwrites it.
The preparation invoked by this method takes place automatically when you call record. Use prepareToRecord when you want recording to start as quickly as possible upon calling record.

AVAudioRecorderMBS.record as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Starts or resumes recording.

Returns true on success, or false on failure.
Calling this method implicitly calls prepareToRecord, which creates (or erases) an audio file and prepares the system for recording.

AVAudioRecorderMBS.recordForDuration(duration as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Records for a specified duration of time.

duration: The maximum duration, in seconds, for the recording.
Returns true on success, or false on failure.

The recorder stops when the duration of recorded audio reaches the value in the duration parameter.

Calling this method implicitly calls prepareToRecord, which creates (or erases) an audio file and prepares the system for recording.

Some examples using this method:

AVAudioRecorderMBS.Recording as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
A Boolean value that indicates whether the audio recorder is recording (true), or not (false). (read-only)

AVAudioRecorderMBS.settings as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The audio settings for the audio recorder. (read-only)

Audio recorder settings are in effect only after you explicitly call the prepareToRecord method, or after you call it implicitly by starting recording. The audio settings keys are described in AV Foundation Audio Settings Constants.

AVAudioRecorderMBS.stop

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Stops recording and closes the audio file.

AVAudioRecorderMBS.updateMeters

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Refreshes the average and peak power values for all channels of an audio recorder.

To obtain current audio power values, you must call this method before you call averagePowerForChannel or peakPowerForChannel.

AVAudioRecorderMBS.url as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The URL for the audio file associated with the audio recorder. (read-only)

The items on this page are in the following plugins: MBS AVFoundation Plugin.


The biggest plugin in space...