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 |
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:
7 | signed byte |
8 | unsigned byte |
15 | signed short |
16 | unsigned short |
24 | unsigned medium |
31 | signed integer |
32 | unsigned 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 |
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:
7 | signed byte |
8 | unsigned byte |
15 | signed short |
16 | unsigned short |
24 | unsigned medium |
31 | signed integer |
32 | unsigned 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 |
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 |
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS MacOSX Plugin | 5.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
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 |
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 |
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 |
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 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 |
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:
7 | signed byte |
8 | unsigned byte |
15 | signed short |
16 | unsigned short |
24 | unsigned medium |
31 | signed integer |
32 | unsigned 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 |
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:
7 | signed byte |
8 | unsigned byte |
15 | signed short |
16 | unsigned short |
24 | unsigned medium |
31 | signed integer |
32 | unsigned 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 |
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 |
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 |
use AddAudio, AddAudioStereo, AddFloatAudio and AddFloatAudioStereo first to fill buffers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Audio | MBS MacOSX Plugin | 5.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The items on this page are in the following plugins: MBS MacOSX Plugin.