Platforms to show: All Mac Windows Linux Cross-Platform
Back to PortAudioMBS class.
PortAudioMBS.CountDevices as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The number of available devices may be zero.
Returns a non-negative value indicating the number of available devices or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered.
PortAudioMBS.DefaultHostApiIndexd as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The default host API will be the lowest common denominator host API on the current platform and is unlikely to provide the best performance.
Returns a non-negative value ranging from 0 to (HostApiCount-1)indicating the default host API index or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered.
Some examples using this method:
PortAudioMBS.DefaultInputDeviceID as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The result can be used in the inputDevice parameter to OpenStream().
Returns the default input device index for the default host API, or paNoDevice (-1) if no default input device is available or an error was encountered.
PortAudioMBS.DefaultOutputDeviceID as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The result can be used in the outputDevice parameter to OpenStream().
Returns the default output device index for the defualt host API, or paNoDevice (-1) if no default output device is available or an error was encountered.
On the PC, the user can specify a default device by setting an environment variable. For example, to use device #1.
set PA_RECOMMENDED_OUTPUT_DEVICE=1
The user should first determine the available device ids by using the supplied application "pa_devs".
PortAudioMBS.DeviceInfo(DeviceIndex as Integer) as PortAudioDeviceInfoMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Returns an object of class PortAudioDeviceInfoMBS with the requested information. If the device parameter is out of range the function returns nil.
DeviceIndex: A valid device index in the range 0 to (PortAudioMBS.CountDevices-1)
PortAudioMBS.ErrorText(ErrorNumber as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
PortAudioMBS.GetSampleSize(Format as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
PortAudioMBS.HostApiCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Even if a host API is available it may have no devices available.
Returns a non-negative value indicating the number of available host APIs or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered.
Some examples using this method:
PortAudioMBS.HostApiDeviceIndexToDeviceIndex(hostApiIndex as Integer, hostApiDeviceIndex as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This function may be used in conjunction with the deviceCount field of PaHostApiInfo to enumerate all devices for the specified host API.
hostApiIndex: A valid host API index ranging from 0 to (HostApiCount-1)
hostApiDeviceIndex: A valid per-host device index in the range 0 to (HostApiInfo(hostApi).deviceCount-1)
Returns a non-negative device index ranging from 0 to (DeviceCount-1) or, an error code (which are always negative) if PortAudio is not initialized or an error is encountered.
A paInvalidHostApi (-9978) error code indicates that the host API index specified by the hostApi parameter is out of range.
A paInvalidDevice (-9996) error code indicates that the hostApiDeviceIndex parameter is out of range.
Some examples using this method:
PortAudioMBS.HostApiInfo(hostApiIndex as Integer) as PortAudioHostApiInfoMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
hostApiIndex: A valid host API index ranging from 0 to (HostApiCount-1)
Returns the information object. If the hostApi parameter is out of range or an error is encountered, the function returns nil.
Some examples using this method:
PortAudioMBS.HostApiTypeIdToHostApiIndex(type as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
type: A unique host API identifier. See PortAudioHostApiInfoMBS.Type for the list of constants.
Returns a valid PaHostApiIndex ranging from 0 to (HostApiCount-1) or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered.
The paHostApiNotFound (-9979) error code indicates that the host API specified by the type parameter is not available.
PortAudioMBS.HostError as PortAudioHostErrorInfoMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This function is provided as a last resort, primarily to enhance debugging by providing clients with access to all available error information.
Returns an object constaining information about the host error. The values in this structure will only be valid if a PortAudio function has previously returned the paUnanticipatedHostError.
PortAudioMBS.IsFormatSupported(input as PortAudioStreamParametersMBS, output as PortAudioStreamParametersMBS, sampleRate as Double) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
input: An object that describes the input parameters used to open a stream. The suggestedLatency field is ignored. inputParameters must be nil for output-only streams.
output: An object that describes the output parameters used to open a stream. The suggestedLatency field is ignored. outputParameters must be nil for input-only streams.
sampleRate: The required sampleRate. For full-duplex streams it is the sample rate for both input and output
Returns 0 if the format is supported, and an error code indicating why the format is not supported otherwise. The constant paFormatIsSupported (0) is provided to compare with the return value for success.
PortAudioMBS.SampleSize(theFormat as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Returns 0 on any error.
Constants for sample format:
const paFloat32 | = 1 |
const paInt32 | = 2 |
const paInt24 | = 4 |
const paInt16 | = 8 |
const paInt8 | = 16 |
const paUInt8 | = 32 |
const paCustomFormat | = 65536 |
const paNonInterleaved | = negative sign |
The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 and aUInt8 are usually implemented by all implementations.
The floating point representation (paFloat32) uses +1.0 and -1.0 as the maximum and minimum respectively.
paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
The paNonInterleaved flag indicates that a multichannel buffer is passed as a set of non-interleaved pointers.
PortAudioMBS.Sleep(msec as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS Audio Plugin | 7.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This function is provided only as a convenience for authors of portable code (such as the tests and examples in the PortAudio distribution.)
The function may sleep longer than requested so don't rely on this for accurate musical timing.
The items on this page are in the following plugins: MBS Audio Plugin.