public class AVAudioPlayer extends NSObject
Modifier and Type | Method and Description |
---|---|
double |
currentTime()
Returns the current location of the playback of this AVAudioPlayer.
|
NSData |
data()
Returns an NSData object that represents the sound of the audio player.
|
AVAudioPlayerDelegate |
delegate()
Returns the delegate of this AVAudioPlayer.
|
double |
duration()
Returns the duration of the sound of this AVAudioPlayer expressed in
seconds.
|
static AVAudioPlayer |
initWithContentsOfURL(NSURL url,
crossmobile.rt.StrongReference<NSError> error)
Constructs and returns an AVAudioPlayer with the specified URL for the
sound and error handing values.
|
static AVAudioPlayer |
initWithData(NSData data,
crossmobile.rt.StrongReference<NSError> error)
Constructs and returns an AVAudioPlayer with the specified NSData and
error handing values.
|
boolean |
isPlaying()
Returns a Boolean that shows whether this AVAudioPlayer is playing a
sound.
|
int |
numberOfChannels()
Returns the number of audio channels of this AVAudioPlayer.
|
int |
numberOfLoops()
Returns the number of repeats of the audio of this AVAudioPlayer.
|
void |
pause()
Pauses the playback of this AVAudioPlayer.
|
boolean |
play()
Plays a sound.
|
boolean |
playAtTime(double time)
Plays a sound at a certain delay.
|
boolean |
prepareToPlay()
Prepares the buffers of this AVAudioPlayer for playing.
|
void |
setCurrentTime(double currentTime)
Sets the current location of the playback for this AVAudioPlayer.
|
void |
setDelegate(AVAudioPlayerDelegate delegate)
Sets the delegate for this AVAudioPlayer.
|
void |
setNumberOfLoops(int numberOfLoops)
Sets the number of repeats of the audio of this AVAudioPlayer.
|
void |
setVolume(float volume)
Sets the sound of this AVAudioPlayer.
|
void |
stop()
Stops the playback of this AVAudioPlayer.
|
NSURL |
url()
Returns the URL of the sound of this AVAudioPlayer.
|
float |
volume()
Returns a number that represents the sound of this AVAudioPlayer.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public static AVAudioPlayer initWithContentsOfURL(NSURL url, crossmobile.rt.StrongReference<NSError> error)
url
- The URL of the sound to play.error
- The error that occurs in case of failure.public static AVAudioPlayer initWithData(NSData data, crossmobile.rt.StrongReference<NSError> error)
data
- The data of the sound to play.error
- The error that occurs in case of failure.public boolean play()
public boolean playAtTime(double time)
time
- The time to begin playback.public void stop()
public void pause()
public boolean prepareToPlay()
public int numberOfLoops()
public void setNumberOfLoops(int numberOfLoops)
numberOfLoops
- The number of repeats of the audio of this
AVAudioPlayer.public AVAudioPlayerDelegate delegate()
public void setDelegate(AVAudioPlayerDelegate delegate)
delegate
- The delegate for this AVAudioPlayer.public boolean isPlaying()
public void setCurrentTime(double currentTime)
currentTime
- The current location of the playback of this
AVAudioPlayer.public double currentTime()
public void setVolume(float volume)
volume
- The sound of this AVAudioPlayer.public float volume()
public int numberOfChannels()
public double duration()
public NSURL url()
public NSData data()
Copyright © 2020. All rights reserved.