C# Класс WPCordovaClassLib.Cordova.Commands.AudioPlayer

Implements audio record and play back functionality.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

AudioPlayer() публичный Метод

Creates AudioPlayer instance
public AudioPlayer ( Media handler, String id ) : System
handler Media Media object
id String player id
Результат System

Dispose() публичный Метод

Destroys player and stop audio playing or recording
public Dispose ( ) : void
Результат void

getCurrentPosition() публичный Метод

Gets current position of playback
public getCurrentPosition ( ) : double
Результат double

getDuration() публичный Метод

Gets the duration of the audio file
public getDuration ( string filePath ) : double
filePath string The name of the audio file
Результат double

pausePlaying() публичный Метод

Pauses playing
public pausePlaying ( ) : void
Результат void

seekToPlaying() публичный Метод

Seek or jump to a new time in the track
public seekToPlaying ( int milliseconds ) : void
milliseconds int The new track position
Результат void

setVolume() публичный Метод

Set the volume of the player
public setVolume ( double vol ) : void
vol double volume 0.0-1.0, default value is 0.5
Результат void

startPlaying() публичный Метод

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
Результат void

startRecording() публичный Метод

Starts recording, data is stored in memory
public startRecording ( string filePath ) : void
filePath string
Результат void

stopPlaying() публичный Метод

Stops playing the audio file
public stopPlaying ( ) : void
Результат void

stopRecording() публичный Метод

Stops recording
public stopRecording ( ) : void
Результат void