Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

AVAudioPlayerMBS.audioPlayerWithData(Data as MemoryBlock, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player for playing a designated memory buffer.
Notes:
data: A block of data containing a sound to play. The audio data must be in a format supported by Core Audio. For a list of supported formats, see "Using Audio" in Multimedia Programming Guide.
Error: Pass in the address of a nil-initialized NSError object. If an error occurs, upon return the NSError object describes the error. If you do not want error information, pass in NULL.

On success, you get an initialized AVAudioPlayer object. Else the handle property is 0 and the Error parameter contains a code that describes the problem.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithData(Data as MemoryBlock, fileTypeHintUtiString as string, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player using the specified data and file type hint.
Notes:
data: The data object containing the audio.
fileTypeHintUtiString: A UTI that is used as a file type hint. The supported UTIs are defined in File Format UTIs.
error: If an error occurs, upon return the NSError object describes the error.

The utiString file type hint tells the parser what kind of sound data to expect so that data that may possibly be corrupt, can be successfully parsed.

Available in OS X v10.9 and later, but plugin calls variant without filetypehint on older versins.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithData(Data as String, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 15.0 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player for playing a designated memory buffer.
Notes:
data: A block of data containing a sound to play. The audio data must be in a format supported by Core Audio. For a list of supported formats, see "Using Audio" in Multimedia Programming Guide.
Error: Pass in the address of a nil-initialized NSError object. If an error occurs, upon return the NSError object describes the error. If you do not want error information, pass in NULL.

On success, you get an initialized AVAudioPlayer object. Else the handle property is 0 and the Error parameter contains a code that describes the problem.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithData(Data as String, fileTypeHintUtiString as string, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 15.0 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player using the specified data and file type hint.
Notes:
data: The data object containing the audio.
fileTypeHintUtiString: A UTI that is used as a file type hint. The supported UTIs are defined in File Format UTIs.
error: If an error occurs, upon return the NSError object describes the error.

The utiString file type hint tells the parser what kind of sound data to expect so that data that may possibly be corrupt, can be successfully parsed.

Available in OS X v10.9 and later, but plugin calls variant without filetypehint on older versins.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithFile(File as folderitem, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player for playing a designated sound file.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.mp3")
dim e as NSErrorMBS
dim u as AVAudioPlayerMBS.audioPlayerWithFile(f,e)
if e<>nil then
MsgBox e.localizedDescription
else
MsgBox str(u.duration)+" seconds"
end if
Notes:
File: A folderitem identifying the sound file to play. The audio data must be in a format supported by Core Audio. For a list of supported formats, see "Using Audio" in Multimedia Programming Guide.
Error: If an error occurs, upon return the NSError object describes the error..

On success, you have an initialized AVAudioPlayer object. On failure, the Error parameter contains a code that describes the problem.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithFile(File as folderitem, fileTypeHintUtiString as string, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player using the specified URL and file type hint.
Notes:
url: A URL identifying the sound file to play. The audio data must be in a format supported by Core Audio.
utiString: A UTI that is used as a file type hint. The supported UTIs are defined in File Format UTIs. See AVFileType* strings.
Error: If an error occurs, upon return the NSError object describes the error.

The utiString file type hint tells the parser what kind of sound data to expect so that files which are not self identifying, or possibly even corrupt, can be successfully parsed.

Available in OS X v10.9 and later, but plugin calls variant without hint for older versions.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithURL(URL as string, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player for playing a designated sound file.
Notes:
url: A URL identifying the sound file to play. The audio data must be in a format supported by Core Audio. For a list of supported formats, see "Using Audio" in Multimedia Programming Guide.
Error: If an error occurs, upon return the NSError object describes the error..

On success, you have an initialized AVAudioPlayer object. On failure, the Error parameter contains a code that describes the problem.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.audioPlayerWithURL(URL as string, fileTypeHintUtiString as string, byref error as NSErrorMBS) as AVAudioPlayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.4 Yes No No Yes, macOS only No
Function: Initializes and returns an audio player using the specified URL and file type hint.
Notes:
url: A URL identifying the sound file to play. The audio data must be in a format supported by Core Audio.
utiString: A UTI that is used as a file type hint. The supported UTIs are defined in File Format UTIs. See AVFileType* strings.
Error: If an error occurs, upon return the NSError object describes the error.

The utiString file type hint tells the parser what kind of sound data to expect so that files which are not self identifying, or possibly even corrupt, can be successfully parsed.

Available in OS X v10.9 and later, but plugin calls variant without hint for older versions.

See also:

Feedback, Comments & Corrections

AVAudioPlayerMBS.available as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Whether this class is available.
Notes: Returns true on Mac OS X 10.7 and newer.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins