Platforms to show: All Mac Windows Linux Cross-Platform

Back to CoreAudioMBS class.

CoreAudioMBS.AudioDeviceGetPropertyCFString(AudioDeviceID as Integer, channel as Integer, isinput as boolean, propertyID as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 10.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Device.
Example

Dim c As New CoreAudioMBS

Dim DefaultInputDeviceMem As MemoryBlock = c.AudioHardwareGetPropertyMemory(c.kAudioHardwarePropertyDefaultInputDevice)
Dim DefaultInputDeviceID As Integer = DefaultInputDeviceMem.Long(0)
Dim DefaultInputDeviceCFName As CFStringMBS = c.AudioDeviceGetPropertyCFString(DefaultInputDeviceID, 0, True, c.kAudioDevicePropertyDeviceNameCFString)
Dim DefaultInputDeviceName As String = DefaultInputDeviceCFName.Str

MessageBox DefaultInputDeviceName

Lasterror is set.
The property you query must be one of the CFString properties.

CoreAudioMBS.AudioDeviceGetPropertyInfo(AudioDeviceID as Integer, channel as Integer, isinput as boolean, propertyID as string, byref size as Integer, byref writeable as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets property information from an Audio Unit.
Example

Dim c As New CoreAudioMBS

Dim DefaultInputDeviceMem As MemoryBlock = c.AudioHardwareGetPropertyMemory(c.kAudioHardwarePropertyDefaultInputDevice)
Dim DefaultInputDeviceID As Integer = DefaultInputDeviceMem.Long(0)

Dim size As Integer
Dim writeable As Boolean

c.AudioDeviceGetPropertyInfo(DefaultInputDeviceID, 0, True, c.kAudioDevicePropertyDeviceName, size, writeable)

If writeable Then
MessageBox "Writeable, "+size.ToString+" bytes"
Else
MessageBox "Read only, "+size.ToString+" bytes"
End If

Lasterror is set.

CoreAudioMBS.AudioDeviceGetPropertyMemory(AudioDeviceID as Integer, channel as Integer, isinput as boolean, propertyID as string) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Device.
Example

Dim c As New CoreAudioMBS

Dim DefaultOutputDeviceMem As MemoryBlock = c.AudioHardwareGetPropertyMemory(c.kAudioHardwarePropertyDefaultOutputDevice)
Dim DefaultOutputDeviceID As Integer = DefaultOutputDeviceMem.Long(0)

Dim mem1 As MemoryBlock = c.AudioDeviceGetPropertyMemory(DefaultOutputDeviceID, 0, False, c.kAudioDevicePropertyVolumeDecibels)
Dim VolumeDecibels As Single = mem1.SingleValue(0)

Dim mem2 As MemoryBlock = c.AudioDeviceGetPropertyMemory(DefaultOutputDeviceID, 0, False, c.kAudioDevicePropertyVolumeScalar)
Dim VolumeScalar As Single = mem2.SingleValue(0)

Break

Lasterror is set.

Some examples using this method:

CoreAudioMBS.AudioDeviceGetPropertyString(AudioDeviceID as Integer, channel as Integer, isinput as boolean, propertyID as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Device.
Example

Dim c As New CoreAudioMBS

Dim DefaultInputDeviceMem As MemoryBlock = c.AudioHardwareGetPropertyMemory(c.kAudioHardwarePropertyDefaultInputDevice)
Dim DefaultInputDeviceID As Integer = DefaultInputDeviceMem.Long(0)
Dim DefaultInputDeviceName As String = c.AudioDeviceGetPropertyString(DefaultInputDeviceID, 0, True, c.kAudioDevicePropertyDeviceName)

MessageBox DefaultInputDeviceName

Lasterror is set.

Some examples using this method:

CoreAudioMBS.AudioDeviceSetPropertyMemory(AudioDeviceID as Integer, when as memoryblock, channel as Integer, isinput as boolean, propertyID as string, data as memoryblock, offset as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Device.
Example

Dim c As New CoreAudioMBS

Dim DefaultOutputDeviceMem As MemoryBlock = c.AudioHardwareGetPropertyMemory(c.kAudioHardwarePropertyDefaultOutputDevice)
Dim DefaultOutputDeviceID As Integer = DefaultOutputDeviceMem.Long(0)

Dim mem1 As MemoryBlock = c.AudioDeviceGetPropertyMemory(DefaultOutputDeviceID, 0, False, c.kAudioDevicePropertyVolumeScalar)
Dim VolumeScalar As Single = mem1.SingleValue(0)

// set volume to 50%
Dim VolumeScalar2 As Single = 0.5
Dim mem2 As New MemoryBlock(4)
mem2.SingleValue(0) = VolumeScalar2

c.AudioDeviceSetPropertyMemory(DefaultOutputDeviceID, Nil, 0, False, c.kAudioDevicePropertyVolumeScalar, mem2, 0, mem2.Size)

// now query again
Dim mem3 As MemoryBlock = c.AudioDeviceGetPropertyMemory(DefaultOutputDeviceID, 0, False, c.kAudioDevicePropertyVolumeScalar)
Dim VolumeScalar3 As Single = mem3.SingleValue(0)

Break

Lasterror is set.

CoreAudioMBS.AudioDeviceSetPropertyString(AudioDeviceID as Integer, when as memoryblock, channel as Integer, isinput as boolean, propertyID as string, data as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Device.

Lasterror is set.

CoreAudioMBS.AudioHardwareGetPropertyCFString(propertyID as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 10.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Hardware.

Lasterror is set.
The property you query must be one of the CFString properties.

CoreAudioMBS.AudioHardwareGetPropertyInfo(propertyID as string, byref size as Integer, byref writeable as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets property information from the Audio Hardware.
Example

Dim c As New CoreAudioMBS

Dim writeable As Boolean
Dim size As Integer
c.AudioHardwareGetPropertyInfo(c.kAudioHardwarePropertyDefaultOutputDevice, size, writeable)

If writeable Then
MessageBox "Writeable, "+size.ToString+" bytes"
else
MessageBox "Read only, "+size.ToString+" bytes"
End If

Lasterror is set.

Some examples using this method:

CoreAudioMBS.AudioHardwareGetPropertyMemory(propertyID as string) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Hardware.
Example

Dim c As New CoreAudioMBS

Dim DefaultInputDeviceMem As MemoryBlock = c.AudioHardwareGetPropertyMemory(c.kAudioHardwarePropertyDefaultInputDevice)
Dim DefaultInputDeviceID As Integer = DefaultInputDeviceMem.Long(0)
Dim DefaultInputDeviceName As String = c.AudioDeviceGetPropertyString(DefaultInputDeviceID, 0, True, c.kAudioDevicePropertyDeviceName)

MessageBox DefaultInputDeviceName

Lasterror is set.

Some examples using this method:

CoreAudioMBS.AudioHardwareGetPropertyString(propertyID as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Hardware.

Lasterror is set.

CoreAudioMBS.AudioHardwareSetPropertyMemory(propertyID as string, data as memoryblock, offset as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Hardware.

Lasterror is set.

CoreAudioMBS.AudioHardwareSetPropertyString(propertyID as string, data as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Hardware.

Lasterror is set.

CoreAudioMBS.AudioObjectGetPropertyData(inObjectID as Integer, AddressSelector as UInt32, AddressScope as UInt32, AddressElement as UInt32, QualifierData as memoryblock = nil, InputData as Memoryblock = nil) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries an AudioObject to get the data of the given property and places it in the provided buffer.

The plugin queries size and creates a buffer for the result.

inObjectID: The AudioObject to query.
AddressSelector, AddressScope or AddressElement: An audio object property address indicating which property is being queried.
QualifierData: A buffer of data to be used in determining the data of the property being queried. Note that not all properties require qualification, in which case this value will be nil.

If InputData is nil, we query size and allocate buffer of required size.
If InputData is not nil, we use this memoryblock with its size. Result is InputData on success.

Lasterror is set.

CoreAudioMBS.AudioObjectGetPropertyDataSize(inObjectID as Integer, AddressSelector as UInt32, AddressScope as UInt32, AddressElement as UInt32, QualifierData as memoryblock = nil) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries an AudioObject to find the size of the data for the given property.

inObjectID: The AudioObject to query.
AddressSelector, AddressScope or AddressElement: An audio object property address indicating which property is being queried.
QualifierData: A buffer of data to be used in determining the data of the property being queried. Note that not all properties require qualification, in which case this value will be nil.

Returns an UInt32 indicating how many bytes the data for the given property occupies.
Lasterror is set.

CoreAudioMBS.AudioObjectSetPropertyData(inObjectID as Integer, AddressSelector as UInt32, AddressScope as UInt32, AddressElement as UInt32, Data as Memoryblock, QualifierData as memoryblock = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Tells an AudioObject to change the value of the given property using the provided data.

inObjectID: The AudioObject to query.
AddressSelector, AddressScope or AddressElement: An audio object property address indicating which property is being queried.
QualifierData: A buffer of data to be used in determining the data of the property being queried. Note that not all properties require qualification, in which case this value will be nil.

Lasterror is set.

CoreAudioMBS.AudioOutputUnitStart(componenthandle as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Starts the Audio Unit.

Errorcode is returned.

CoreAudioMBS.AudioOutputUnitStop(componenthandle as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Stops the AudioUnit.

Errorcode is returned.

CoreAudioMBS.AudioStreamGetPropertyCFString(AudioStreamID as Integer, channel as Integer, propertyID as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 10.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Stream.

Lasterror is set.
The property you query must be one of the CFString properties.

CoreAudioMBS.AudioStreamGetPropertyInfo(AudioStreamID as Integer, channel as Integer, propertyID as string, byref size as Integer, byref writeable as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets property information from an Audio Stream.

Lasterror is set.

CoreAudioMBS.AudioStreamGetPropertyMemory(AudioStreamID as Integer, channel as Integer, propertyID as string) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Stream.

Lasterror is set.

CoreAudioMBS.AudioStreamGetPropertyString(AudioStreamID as Integer, channel as Integer, propertyID as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property value from the Audio Stream.

Lasterror is set.

CoreAudioMBS.AudioStreamSetPropertyMemory(AudioStreamID as Integer, when as memoryblock, channel as Integer, propertyID as string, data as memoryblock, offset as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Stream.

Lasterror is set.

CoreAudioMBS.AudioStreamSetPropertyString(AudioStreamID as Integer, when as memoryblock, channel as Integer, propertyID as string, data as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Stream.

Lasterror is set.

CoreAudioMBS.AudioUnitGetParameter(AudioUnit as Integer, ParameterID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer) as single

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets an audio unit parameter.

CoreAudioMBS.AudioUnitGetPropertyCFString(AudioUnit as Integer, propertyID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 10.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property of an Audio Unit.

Lasterror is set.
Constants for AudioUnitScope:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

The property you query must be one of the CFString properties.

CoreAudioMBS.AudioUnitGetPropertyInfo(AudioUnit as Integer, propertyID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer, byref size as Integer, byref writeable as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets property information from the Audio Unit.

Lasterror is set.
Constants for AudioUnitScope:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

CoreAudioMBS.AudioUnitGetPropertyMemory(AudioUnit as Integer, propertyID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property of an Audio Unit.

Lasterror is set.
Constants for AudioUnitScope:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

CoreAudioMBS.AudioUnitGetPropertyString(AudioUnit as Integer, propertyID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets a property of an Audio Unit.

Lasterror is set.
Constants for AudioUnitScope:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

CoreAudioMBS.AudioUnitInitialize(componenthandle as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes the Audio Unit.

Errorcode is returned.

CoreAudioMBS.AudioUnitReset(componenthandle as Integer, scope as Integer, element as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Resets the Audio Unit.

Errorcode is returned.

Useful constants:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

CoreAudioMBS.AudioUnitSetPropertyMemory(AudioUnit as Integer, propertyID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer, data as memoryblock, offset as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property of an Audio Unit.

Lasterror is set.
Constants for AudioUnitScope:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

CoreAudioMBS.AudioUnitSetPropertyString(AudioUnit as Integer, propertyID as Integer, AudioUnitScope as Integer, AudioUnitElement as Integer, data as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property value for the Audio Unit.

Lasterror is set.
Constants for AudioUnitScope:
kAudioUnitScope_Global= 0
kAudioUnitScope_Input= 1
kAudioUnitScope_Output= 2
kAudioUnitScope_Group= 3
kAudioUnitScope_Part= 4

CoreAudioMBS.AudioUnitUninitialize(componenthandle as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Uninitializes the Audio Unit.

Errorcode is returned.

CoreAudioMBS.CloseComponent(componenthandle as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Closes a component.

Do not use the componenthandle any more after this call!

CoreAudioMBS.OpenDefaultComponent(type as string, subtype as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Opens the default component for the given type and subtype string.
Example

Dim c As New CoreAudioMBS

Const kAudioUnitComponentType = "aunt"
Const kAudioUnitSubType_Output = "out "

// open default output component
Dim n As Integer = c.OpenDefaultComponent(kAudioUnitComponentType, kAudioUnitSubType_Output)

If n = 0 Then
Break // failed
Else
Break
// okay, so close
c.CloseComponent(n)
End If

You can check the "QT Components list" example project for which components are installed.
Returns 0 on any error.
type and subtype must be 4 letter codes.

useful constans:
kAudioUnitComponentType= "aunt"
kAudioUnitSubType_Output= "out "
kAudioUnitID_HALOutput= "ahal"
kAudioUnitID_DefaultOutput= "def "
kAudioUnitID_SystemOutput= "sys "
kAudioUnitID_GenericOutput= "genr"
kAudioUnitSubType_MusicDevice= "musd"
kAudioUnitID_DLSSynth= "dls "
kAudioUnitSubType_SampleRateConverter= "srcv"
kAudioUnitID_PolyphaseSRC= "poly"
kAudioUnitSubType_FormatConverter= "fmtc"
kAudioUnitID_Interleaver= "inlv"
kAudioUnitID_Deinterleaver= "dnlv"
kAudioUnitID_AUConverter= "conv"
kAudioUnitSubType_Effect= "efct"
kAudioUnitID_MatrixReverb= "mrev"
kAudioUnitID_Delay= "dely"
kAudioUnitID_LowPassFilter= "lpas"
kAudioUnitID_HighPassFilter= "hpas"
kAudioUnitID_BandPassFilter= "bpas"
kAudioUnitID_PeakLimiter= "lmtr"
kAudioUnitID_DynamicsProcessor= "dcmp"
kAudioUnitSubType_Mixer= "mixr"
kAudioUnitID_StereoMixer= "smxr"
kAudioUnitID_3DMixer= "3dmx"

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


The biggest plugin in space...