AVAudioPlayerMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

AVAudioPlayerMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
An instance of the AVAudioPlayer class, called an audio player, provides playback of audio data from a file or memory.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.mp3")
dim e as NSErrorMBS
dim u as new AVAudioPlayerMBS(f,e)
if e<>nil then
MsgBox e.localizedDescription
else
MsgBox str(u.duration)+" seconds"
end if

Apple recommends that you use this class for audio playback unless you are playing audio captured from a network stream or require very low I/O latency. For an overview of audio technologies, see Audio & Video Starting Point and "Using Audio" in Multimedia Programming Guide.

Using an audio player you can:


The AVAudioPlayer class lets you play sound in any audio format available in OS X. The plugin provides the events for this audio player in AVFoundationMBS class.

To play, pause, or stop an audio player, call one of its playback control methods, described in "Configuring and Controlling Playback."

To configure an appropriate audio session for playback, refer to AVAudioSession Class Reference and AVAudioSessionDelegate Protocol Reference. To learn how your choice of file formats impacts the simultaneous playback of multiple sounds, refer to "iPhone Hardware and Software Audio Codecs" in Multimedia Programming Guide.

This class has no sub classes.

Some methods using this class:

Some events using this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes


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


AVAudioPCMBufferMBS   -   AVAudioPlayerNodeMBS


💬 Ask a question or report a problem