|
| AudioStreamPlayer (System.IO.Stream audioStream, bool readFormatFromStream=true) |
| Class constructor.
|
|
override int | CalcMeterValue (byte[] data, int dataLength) |
| Calculate how much noice is in the audio stream.
|
|
override void | Free () |
| Stops recording, and free resources.
|
|
override bool | Initialize () |
| Call this to initialize. Reads the stream format from the stream input if the readFormatFromStream parameter (from the constructor) equals true.
|
|
override bool | IsRecording () |
| Indicates if it is recording.
|
|
void | ReadFormatFromStream () |
| Read the stream format from the stream input. It is called by the Initialize() function if the readFormatFromStream parameter equals true. Please note that it must be in RIFF / WAVE format.
|
|
override void | StartRecording () |
| Starts recording.
|
|
override void | StopRecording () |
| Stops recording.
|
|
delegate void | AudioDataReadyEventHandler (object sender, AudioDataEventArgs e) |
| Represents the method that will signal Audio Data Ready.
|
|
virtual void | FireAudioDataReadyEvent (byte[] audioData) |
| Activates the AudioDataReadyEvent.
|
|
|
virtual short | BlockAlign [get, set] |
| Set the Block align value. Alternatively call the ReadFormatFromStream.
|
|
virtual int | DataSize [get, set] |
| Set the total data size. The Player will stop when this number is reached. Alternatively call the ReadFormatFromStream.
|
|
virtual int | ForwardSampleBlockSize [get, set] |
| The number of Samples to forward to the Speaker at a time. Default is OutgoingAudioWaveFormatSamplesPerSecond / 20.
|
|
double | Progress [get] |
| If DataSize is set to a value > 0, then it returns a double value 0.0 .. 1.0 indicate the progress of the read process. Otherwise it returns -1.0.
|
|
virtual int | OutgoingAudioWaveFormatSamplesPerSecond [get, set] |
| Specify number of samples per second - default is 8000.
|
|
virtual int | OutgoingWaveFormatBitsPerSample [get, set] |
| Specify the bits per sample - default is 16.
|
|
virtual int | OutgoingWaveFormatChannels [get, set] |
| Number of channels, expected to be 1.
|
|
Streams PCM data from an input stream to the OutgoingSpeakerController.
It will pace the reading to match the sample rate except for a prebuffer read = 2 * ForwardSampleBlockSize samples. The default for ForwardSampleBlockSize is OutgoingAudioWaveFormatSamplesPerSecond / 20 = 50 msec of samples.
It assumes by default that the input is a WAV formatted input file and reads the settings from the WAV header, if created like this:
_outgoingSpeakerController.Init(player); <br>
_outgoingSpeakerController.ShowLive = true;
_outgoingSpeakerController.Connect();
It may also be created with a binary stream without WAV header and then configured directly, like in
player.OutgoingWaveFormatChannels = 1;
player.OutgoingWaveFormatBitsPerSample = 16;
player.OutgoingAudioWaveFormatSamplesPerSecond = 8000;
player.BlockAlign = player.OutgoingWaveFormatChannels * player.OutgoingWaveFormatBitsPerSample / 8;
player.DataSize = 0;
_outgoingSpeakerController.Init(player); <br>
_outgoingSpeakerController.ShowLive = true;
_outgoingSpeakerController.Connect();