Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

AVAudioPlayerMBS.currentDevice as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 18.4 Yes No No Yes, macOS only No
Function: The UID of the current audio device (as a string).
Notes:
Available on MacOS 10.13 or newer.
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.currentTime as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The playback point, in seconds, within the timeline of the sound associated with the audio player.
Notes:
If the sound is playing, currentTime is the offset of the current playback position, measured in seconds from the start of the sound. If the sound is not playing, currentTime is the offset of where playing starts upon calling the play method, measured in seconds from the start of the sound.

By setting this property you can seek to a specific point in a sound file or implement audio fast-forward and rewind functions.
(Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.data as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The data object containing the sound associated with the audio player. (read-only)
Notes:
Returns nil if the audio player has no data (that is, if it was not initialized with an Memoryblock).
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.deviceCurrentTime as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The time value, in seconds, of the audio output device. (read-only)
Notes:
The value of this property increases monotonically while an audio player is playing or paused.

If more than one audio player is connected to the audio output device, device time continues incrementing as long as at least one of the players is playing or paused.

If the audio output device has no connected audio players that are either playing or paused, device time reverts to 0.

Use this property to indicate "now" when calling the playAtTime instance method. By configuring multiple audio players to play at a specified offset from deviceCurrentTime, you can perform precise synchronization—as described in the discussion for that method.
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.duration as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns the total duration, in seconds, of the sound associated with the audio player. (read-only)
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
Notes: (Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.enableRate as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 14.0 Yes No No Yes, macOS only No
Function: A Boolean value that specifies whether playback rate adjustment is enabled for an audio player.
Notes:
To enable adjustable playback rate for an audio player, set this property to YES after you initialize the player and before you call the prepareToPlay instance method for the player.
Available in OS X v10.8 and later.
(Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.Handle as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The internal object reference.
Notes: (Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.isPlaying as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: A Boolean value that indicates whether the audio player is playing (true) or not (false). (read-only)
Notes:
To find out when playback has stopped, use the AVFoundationMBS.audioPlayerDidFinishPlaying event.

Important: Do not poll this property (that is, do not use it inside of a loop) in an attempt to discover when playback has stopped.
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.meteringEnabled as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: A Boolean value that specifies the audio-level metering on/off state for the audio player.
Notes:
The default value for the meteringEnabled property is off (Boolean false). Before using metering for an audio player, you need to enable it by setting this property to true.
(Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.Name as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 18.3 Yes No No Yes, macOS only No
Function: The name of the audio file.
Notes:
This uses the URL to pull the display name if possible, so you can show it to user or identify the player when debugging.
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.numberOfChannels as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The number of audio channels in the sound associated with the audio player. (read-only)
Notes: (Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.numberOfLoops as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The number of times a sound will return to the beginning, upon reaching the end, to repeat playback.
Notes:
A value of 0, which is the default, means to play the sound once. Set a positive integer value to specify the number of times to return to the start and play again. For example, specifying a value of 1 results in a total of two plays of the sound. Set any negative integer value to loop the sound indefinitely until you call the stop method.
(Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.pan as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The audio player's stereo pan position.
Notes:
By setting this property you can position a sound in the stereo field. A value of –1.0 is full left, 0.0 is center, and 1.0 is full right.
(Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.rate as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 14.0 Yes No No Yes, macOS only No
Function: The audio player's playback rate.
Example:
dim s as sound // your sound
dim a as AVAudioPlayerMBS = s.AVAudioPlayerMBS
a.rate = 0.5
Notes:
This property's default value of 1.0 provides normal playback rate. The available range is from 0.5 for half-speed playback through 2.0 for double-speed playback.

To set an audio player's playback rate, you must first enable rate adjustment as described in the enableRate property description.
Available in OS X v10.8 and later.
(Read and Write property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.settings as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The audio player's settings dictionary, containing information about the sound associated with the player. (read-only)
Notes:
An audio player's settings dictionary contains keys for the following information about the player's associated sound:

Channel layout (AVChannelLayoutKey)
Encoder bit rate (AVEncoderBitRateKey)
Audio data format (AVFormatIDKey)
Channel count (AVNumberOfChannelsKey)
Sample rate (AVSampleRateKey)

The settings keys are described in AV Foundation Audio Settings Constants.
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.URL as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The URL for the sound associated with the audio player. (read-only)
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 u.URL
end if
Notes:
Returns "" if the audio player was not initialized with a URL.
(Read only property)

Feedback, Comments & Corrections

AVAudioPlayerMBS.volume as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The playback gain for the audio player, ranging from 0.0 through 1.0.
Notes: (Read and Write property)

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins