Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVAudioPlayerNodeMBS class.

AVAudioPlayerNodeMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The constructor.

AVAudioPlayerNodeMBS.nodeTimeForPlayerTime(playerTime as AVAudioTimeMBS) as AVAudioTimeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Convert from player time to node time.

playerTime: A time relative to the player’s start time.

Returns a node time.

This method and its inverse playerTimeForNodeTime are discussed in The Player Timeline. If the player is not playing when this method is called, nil is returned.

AVAudioPlayerNodeMBS.pause

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Pause playback.

The player's sample time does not advance while the node is paused.

AVAudioPlayerNodeMBS.play

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Start or resume playback immediately.

This is equivalent to playAtTime with a value of nil.

AVAudioPlayerNodeMBS.playAtTime(time as AVAudioTimeMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Start or resume playback at a specific time.
Example
Dim p As AVAudioPlayerNodeMBS // your player node
Dim t As AVAudioTimeMBS = AVAudioTimeMBS.timeWithSampleTime(60000, 1000) // 60s

p.playAtTime(t)

when: The node time at which to start or resume playback. Passing nil starts playback immediately.

This node is initially paused. Requests to play buffers or file segments are enqueued, and any necessary decoding begins immediately. Playback does not begin, however, until the player has started playing, via this method.

AVAudioPlayerNodeMBS.playerTimeForNodeTime(nodeTime as AVAudioTimeMBS) as AVAudioTimeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Convert from node time to player time.

nodeTime: The node time.

Returns a time relative to the player’s start time.

This method and its inverse nodeTimeForPlayerTime are discussed in The Player Timeline. If the player is not playing when this method is called, nil is returned.

Some examples using this method:

AVAudioPlayerNodeMBS.prepareWithFrameCount(frameCount as UInt32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Prepares previously scheduled file regions or buffers for playback.

frameCount: The number of sample frames of data to be prepared before returning.

AVAudioPlayerNodeMBS.scheduleBuffer(buffer as AVAudioPCMBufferMBS, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing samples from an audio buffer.

buffer: The buffer to play.

Calls scheduleBufferCompleted event later when playback is done.
time will be nil and options be zero in that case.

Schedules the buffer to be played following any previously scheduled commands.

See also:

AVAudioPlayerNodeMBS.scheduleBuffer(buffer as AVAudioPCMBufferMBS, time as AVAudioTimeMBS, options as Integer, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing samples from an audio buffer at the specified time and with the specified playback options.

buffer: The buffer to play.
when: The time at which to play the buffer.
options: Playback options.

Calls later scheduleBufferCompleted event after the buffer has completely played or the player is stopped.

See also:

AVAudioPlayerNodeMBS.scheduleBuffer(callbackType as Integer, buffer as AVAudioPCMBufferMBS, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing samples from an AVAudioBuffer.

buffer: the buffer to play
callbackType: option to specify when the completion handler must be called

The scheduleBufferCompleted event is called after the buffer has been consumed by the player or has finished playing back or the player is stopped.

Schedules the buffer to be played following any previously scheduled commands.

Available in MacOS 10.13 or newer.

See also:

AVAudioPlayerNodeMBS.scheduleBuffer(callbackType as Integer, buffer as AVAudioPCMBufferMBS, time as AVAudioTimeMBS, options as Integer, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing samples from an AVAudioBuffer.

buffer: the buffer to play
time: the time at which to play the buffer. see the discussion of timestamps, above.
options: options for looping, interrupting other buffers, etc.
callbackType: option to specify when the completion handler must be called.

The scheduleBufferCompleted event is called after the buffer has been consumed by the player or has finished playing back or the player is stopped.

Available in MacOS 10.13 or newer.

See also:

AVAudioPlayerNodeMBS.scheduleFile(callbackType as Integer, file as AVAudioFileMBS, time as AVAudioTimeMBS, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing of an entire audio file.

file: the file to play
time: the time at which to play the file. see the discussion of timestamps, above.
callbackType: option to specify when the completion handler must be called

The scheduleFileCompleted event is called after the file has been consumed by the player or has finished playing back or the player is stopped.

Available in MacOS 10.13 or newer.

See also:

Some examples using this method:

AVAudioPlayerNodeMBS.scheduleFile(file as AVAudioFileMBS, time as AVAudioTimeMBS, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing of an entire audio file.

file: The file to play.
when: The time at which to play the buffer.

Calls later scheduleFileCompleted event when playback is done.

See also:

AVAudioPlayerNodeMBS.scheduleSegment(callbackType as Integer, file as AVAudioFileMBS, time as AVAudioTimeMBS, startFrame as Int64, frameCount as Int64, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 18.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing a segment of an audio file.

file: the file to play
startFrame: the starting frame position in the stream
frameCount: the number of frames to play
time: the time at which to play the region. see the discussion of timestamps, above.
callbackType: option to specify when the completion handler must be called

The scheduleSegmentCompleted event is called after the segment has been consumed by the player or has finished playing back or the player is stopped.

Available in MacOS 10.13 or newer.

See also:

Some examples using this method:

AVAudioPlayerNodeMBS.scheduleSegment(file as AVAudioFileMBS, time as AVAudioTimeMBS, startFrame as Int64, frameCount as Int64, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Schedule playing a segment of an audio file.

file: The audio file of the file to play.
startFrame: The starting frame position in the stream.
frameCount: The number of frames to play.
when: The time at which to play the buffer.

Calls later scheduleSegmentCompleted event.

See also:

AVAudioPlayerNodeMBS.stop

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundationNode MBS AVFoundation Plugin 15.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Clear all of the node's previously scheduled events and stop playback.

All of the node’s previously scheduled events are cleared, including any that are in the middle of playing. The node’s sample time (and therefore the times to which new events are to be scheduled) is reset to 0, and will not proceed until the node is started again by sending a play or playAtTime message.

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


The biggest plugin in space...