C# Class WPCordovaClassLib.Cordova.Commands.AudioPlayer

Implements audio record and play back functionality.
Inheritance: IDisposable
Afficher le fichier Open project: ChristianWeyer/tUdUs Class Usage Examples

Méthodes publiques

Méthode Description
AudioPlayer ( Media handler, String id ) : System

Creates AudioPlayer instance

Dispose ( ) : void

Destroys player and stop audio playing or recording

getCurrentPosition ( ) : double

Gets current position of playback

getDuration ( string filePath ) : double

Gets the duration of the audio file

pausePlaying ( ) : void

Pauses playing

seekToPlaying ( int milliseconds ) : void

Seek or jump to a new time in the track

setVolume ( double vol ) : void

Set the volume of the player

startPlaying ( string filePath ) : void

Starts or resume playing audio file

Starts or resume playing audio file

startRecording ( string filePath ) : void

Starts recording, data is stored in memory

stopPlaying ( ) : void

Stops playing the audio file

stopRecording ( ) : void

Stops recording

Private Methods

Méthode Description
FinalizeXnaGameLoop ( ) : void

Finalizes XNA game loop for microphone

InitializeXnaGameLoop ( ) : void

Special initialization required for the microphone: XNA game loop

InvokeCallback ( int message, double value, bool removeHandler ) : void
InvokeCallback ( int message, int value, bool removeHandler ) : void
InvokeCallback ( int message, string value, bool removeHandler ) : void
MediaEnded ( object sender, RoutedEventArgs arg ) : void

Callback to be invoked when playback of a media source has completed

MediaFailed ( object sender, RoutedEventArgs arg ) : void

Callback to be invoked when playback of a media source has failed

MediaOpened ( object sender, RoutedEventArgs arg ) : void

Callback to be invoked when the media source is ready for playback

SaveAudioClipToLocalStorage ( ) : void

Writes audio data from memory to isolated storage

SetState ( int state ) : void

Sets the state and send it to JavaScript

recorderBufferReady ( object sender, EventArgs e ) : void

Copies data from recorder to memory storages and updates recording state

Method Details

AudioPlayer() public méthode

Creates AudioPlayer instance
public AudioPlayer ( Media handler, String id ) : System
handler Media Media object
id String player id
Résultat System

Dispose() public méthode

Destroys player and stop audio playing or recording
public Dispose ( ) : void
Résultat void

getCurrentPosition() public méthode

Gets current position of playback
public getCurrentPosition ( ) : double
Résultat double

getDuration() public méthode

Gets the duration of the audio file
public getDuration ( string filePath ) : double
filePath string The name of the audio file
Résultat double

pausePlaying() public méthode

Pauses playing
public pausePlaying ( ) : void
Résultat void

seekToPlaying() public méthode

Seek or jump to a new time in the track
public seekToPlaying ( int milliseconds ) : void
milliseconds int The new track position
Résultat void

setVolume() public méthode

Set the volume of the player
public setVolume ( double vol ) : void
vol double volume 0.0-1.0, default value is 0.5
Résultat void

startPlaying() public méthode

Starts or resume playing audio file Starts or resume playing audio file
public startPlaying ( string filePath ) : void
filePath string The name of the audio file
Résultat void

startRecording() public méthode

Starts recording, data is stored in memory
public startRecording ( string filePath ) : void
filePath string
Résultat void

stopPlaying() public méthode

Stops playing the audio file
public stopPlaying ( ) : void
Résultat void

stopRecording() public méthode

Stops recording
public stopRecording ( ) : void
Résultat void