AVAudioPlayer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An audio player that can play audio from memory or the local file system.
[Foundation.Register("AVAudioPlayer", true)]
public class AVAudioPlayer : Foundation.NSObject
[<Foundation.Register("AVAudioPlayer", true)>]
type AVAudioPlayer = class
inherit NSObject
- Inheritance
- Attributes
Constructors
| Name | Description |
|---|---|
| AVAudioPlayer(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| AVAudioPlayer(NSData, String, NSError) | |
| AVAudioPlayer(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
| AVAudioPlayer(NSUrl, String, NSError) | |
Properties
| Name | Description |
|---|---|
| AccessibilityAttributedUserInputLabels | (Inherited from NSObject) |
| AccessibilityRespondsToUserInteraction | (Inherited from NSObject) |
| AccessibilityTextualContext | (Inherited from NSObject) |
| AccessibilityUserInputLabels | (Inherited from NSObject) |
| ChannelAssignments |
The channel descriptions for the audio player. |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| CurrentDevice | |
| CurrentTime | |
| Data | |
| DebugDescription | (Inherited from NSObject) |
| Delegate |
An instance of the AVFoundation.IAVAudioPlayerDelegate model class which acts as the class delegate. |
| Description | (Inherited from NSObject) |
| DeviceCurrentTime |
A value that increases while the AVAudioPlayer is playing or paused. Used for synchronizing multiple audio players. |
| Duration | |
| EnableRate |
Whether the AVAudioPlayer can have its playback rate adjusted. |
| ExposedBindings | (Inherited from NSObject) |
| Format | |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| IsDirectBinding |
Gets or sets a value indicating whether this instance uses direct Objective-C binding. (Inherited from NSObject) |
| IsProxy | (Inherited from NSObject) |
| MeteringEnabled |
Whether audio-level metering can be used with the AVAudioPlayer. |
| NumberOfChannels |
The number of audio channels in the sound associated with the AVAudioPlayer. |
| NumberOfLoops |
The number of times the sound should repeat. |
| Pan |
The current stereo pan (left-right) position. |
| Playing |
Whether the AVAudioPlayer is playing sound. |
| Rate | |
| RetainCount | (Inherited from NSObject) |
| Self | (Inherited from NSObject) |
| SoundSetting |
Information about the sound associated with the AVAudioPlayer |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| Url | |
| Volume | |
| WeakDelegate | |
| WeakSettings | |
| Zone | (Inherited from NSObject) |
Methods
Events
| Name | Description |
|---|---|
| BeginInterruption |
Raised when an audio session interruption begins, typically because another app or the system has taken over audio playback (for example, an incoming phone call). Playback is paused for the duration of the interruption. |
| DecoderError |
Raised when decoding an audio buffer fails while the sound is playing. |
| EndInterruption |
Raised when a prior audio session interruption ends, indicating that the app may resume audio playback. |
| FinishedPlaying |
Raised when the player finishes playing the audio to the end. |