Platforms to show: All Mac Windows Linux Cross-Platform

Back to CoreAudioPlayerMBS class.

CoreAudioPlayerMBS.AddAudio(Data as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, BitSize as Integer=16, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds integer audio.

Data: a memoryblock with the sound data
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

You need to set NumberOfChannels before calling this method.
NumberOfChannels can be 1 or 2. For 2 channels, sound data must be interleaved.

Values for bitsize:
7signed byte
8unsigned byte
15signed short
16unsigned short
24unsigned medium
31signed integer
32unsigned integer

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.AddAudioStereo(Data1 as memoryblock, Data2 as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, BitSize as Integer=16, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds integer audio.

This is a special version of PlayAudio which takes samples from both memoryblocks and interleaves them.

Data1: a memoryblock with the sound data
Data2: a memoryblock with the sound data
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

You need to set NumberOfChannels before calling this method.
NumberOfChannels must be 2 for this method.

Values for bitsize:
7signed byte
8unsigned byte
15signed short
16unsigned short
24unsigned medium
31signed integer
32unsigned integer

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.AddFloatAudio(FloatData as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds float audio.

FloatData: a memoryblock with the sound data filled with single values.
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

The samples are stored in 32bit float values (memoryblock.SingleValue)

You need to set NumberOfChannels before calling this method.
NumberOfChannels can be 1 or 2. For 2 channels, sound data must be interleaved.

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.AddFloatAudioStereo(FloatData1 as memoryblock, FloatData2 as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds float audio.

This is a special version of PlayFloatAudio which takes samples from both memoryblocks and interleaves them.

FloatData1: a memoryblock with the sound data filled with single values.
FloatData2: a memoryblock with the sound data filled with single values.
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

The samples are stored in 32bit float values (memoryblock.SingleValue)

You need to set NumberOfChannels before calling this method.
NumberOfChannels must be 2 for this method.

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 5.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The destructor.

There is no need to call this method except you want to free all resources of this object now without waiting for Xojo to do it for you.

CoreAudioPlayerMBS.FreeSpace as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the number of buffer entries available in the queue.

The size of the buffers is not limited except your available memory.

CoreAudioPlayerMBS.HardwareNumberOfChannels as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the actual number of channels in the default device; to set the number of channels being output, use numberOfChannels.

This class can only play stereo to 2 channel devices or mono to all channels.
Returns 0 on any error.

CoreAudioPlayerMBS.HardwareSampleRate as single

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The hardware sample rate.

Today this is normally 44100 Hz. Or 0 on any error.

CoreAudioPlayerMBS.HasFreeSpace as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 4.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns true if the internal sound buffer is not full.

Returns true if freespace returns a value greater than zero.

This function was named IsQueueEmpty in plugin version 7.4.

CoreAudioPlayerMBS.PlayAudio(Data as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, BitSize as Integer=16, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds integer audio and starts playback.

Data: a memoryblock with the sound data
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

You need to set NumberOfChannels before calling this method.
NumberOfChannels can be 1 or 2. For 2 channels, sound data must be interleaved.

Values for bitsize:
7signed byte
8unsigned byte
15signed short
16unsigned short
24unsigned medium
31signed integer
32unsigned integer

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.PlayAudioStereo(Data1 as memoryblock, Data2 as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, BitSize as Integer=16, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds integer audio and starts playback.

This is a special version of PlayAudio which takes samples from both memoryblocks and interleaves them.

Data1: a memoryblock with the sound data
Data2: a memoryblock with the sound data
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

You need to set NumberOfChannels before calling this method.
NumberOfChannels must be 2 for this method.

Values for bitsize:
7signed byte
8unsigned byte
15signed short
16unsigned short
24unsigned medium
31signed integer
32unsigned integer

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.PlayFloatAudio(FloatData as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds float audio and starts playback.

FloatData: a memoryblock with the sound data filled with single values.
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

The samples are stored in 32bit float values (memoryblock.SingleValue)

You need to set NumberOfChannels before calling this method.
NumberOfChannels can be 1 or 2. For 2 channels, sound data must be interleaved.

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.PlayFloatAudioStereo(FloatData1 as memoryblock, FloatData2 as memoryblock, offsetBytes as Integer=0, countBytes as Integer=0, ClearBuffers as boolean=false) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Adds float audio and starts playback.

This is a special version of PlayFloatAudio which takes samples from both memoryblocks and interleaves them.

FloatData1: a memoryblock with the sound data filled with single values.
FloatData2: a memoryblock with the sound data filled with single values.
offsetBytes: the number of the bytes to start playing (0=first)
countBytes: the number of bytes to play from offset.

The samples are stored in 32bit float values (memoryblock.SingleValue)

You need to set NumberOfChannels before calling this method.
NumberOfChannels must be 2 for this method.

This method only copies the data to the internal queue. It returns directly.
If ClearBuffers is true the buffer list is cleared before this new data is added.

CoreAudioPlayerMBS.Start as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 7.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Starts playback.

use AddAudio, AddAudioStereo, AddFloatAudio and AddFloatAudioStereo first to fill buffers.

CoreAudioPlayerMBS.Stop

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Audio MBS MacOSX Plugin 5.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Stops playback.

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


The biggest plugin in space...