![]() |
Halyri - Häke
0.9
|
Class for processing incoming and outgoing audio and images. Handles media data received from the server. Reproduces speex encoded audio and Wave file segments using the primary audio output device in the system. More...
Public Member Functions | |
AudioVideoTransferManager (Connection c) | |
Initializes a new AudioVideoTransferManager that uses the provided connection to receive and transmit audio and pictures. More... | |
void | EnableOutgoingAudio () |
Enables audio recording and publishing to the server from the primary audio capture in the system. More... | |
void | DisableOutgoingAudio () |
Stops recording audio and publishing it to the server. More... | |
void | EnableIncomingAudio () |
Starts receiving audio from the server and reproducing it using the primary audio output device in the system. More... | |
void | DisableIncomingAudio () |
Stops receiving and reproducing audio. More... | |
Public Attributes | |
JpgImageReceived | JpgImageReceivedEvent |
Properties | |
bool | UseOutgoingUdp [get, set] |
Gets and sets UseOutGoingUdp. More... | |
Private Member Functions | |
void | InitializeSpeex () |
Initializes speex audio encoder and decoder. More... | |
void | InitializeAudioIODevices () |
Initializes NAudio WaveIn and WaveOut used to capture and reproduce audio. More... | |
void | SpeexAudioReceived (byte[] speexData, int originatingLength) |
Handles incoming speex audio segments. Decompresses them into PCM that is added into the bufferedWaveStream from which the active WaveOut instance reads and reproduces them. More... | |
void | MicrophoneDataAvailable (object sender, WaveInEventArgs e) |
Handles PCM data segments captured by the active WaveIn instance. More... | |
void | UdpMediaReceivedHandler (object sender, MediaPacket mediaPacket) |
Handles incoming media received by the active Connection instance over the UDP channel. Supported formats are jpg images and speex encoded audio. More... | |
void | TcpMediaReceivedHandler (object sender, MediaInformationDto info, byte[] data) |
Handles incoming media received by the active Connection instance over the WCF TCP channel. Supported formats are jpg images and wave audio fragments with pcm payload. More... | |
void | PlayWaveFragment (byte[] audio) |
Plays a wave file using a new SoundPlayer instance. More... | |
Private Attributes | |
MediaInformation | outgoingSpeexInformation = new MediaInformation(MediaFormat.Speex, TransferCompression.None) |
WaveFormat | AudioCaptureFormat |
const int | speexFramesInSecond = 50 |
const int | defaultSpeexQuality = 2 |
SpeexDecoder | decoder |
SpeexEncoder | encoder |
IWaveIn | recorder |
WaveOut | player |
bool | audioPlaybackActive = false |
BufferWaveStream | bufferedWaveStream |
object | playbackConfigurationLock = new object() |
Connection | connection |
bool | useOutgoingUdp = true |
Class for processing incoming and outgoing audio and images. Handles media data received from the server. Reproduces speex encoded audio and Wave file segments using the primary audio output device in the system.
<author>Veli-Mikko Puupponen</author> Captures audio from the dafault audio input device in the system using a NAudio WaveIn instance. If outgoing audio is enabled, uploads the captured audio in a speex encoded format to the server.
Publishes a JpgImageReceivedEvent upon receiving an image from the server.
Hake_WPF.AudioVideoManagers.AudioVideoTransferManager.AudioVideoTransferManager | ( | Connection | c | ) |
Initializes a new AudioVideoTransferManager that uses the provided connection to receive and transmit audio and pictures.
c | Valid Connection instance. |
void Hake_WPF.AudioVideoManagers.AudioVideoTransferManager.DisableIncomingAudio | ( | ) |
Stops receiving and reproducing audio.
void Hake_WPF.AudioVideoManagers.AudioVideoTransferManager.DisableOutgoingAudio | ( | ) |
Stops recording audio and publishing it to the server.
void Hake_WPF.AudioVideoManagers.AudioVideoTransferManager.EnableIncomingAudio | ( | ) |
Starts receiving audio from the server and reproducing it using the primary audio output device in the system.
void Hake_WPF.AudioVideoManagers.AudioVideoTransferManager.EnableOutgoingAudio | ( | ) |
Enables audio recording and publishing to the server from the primary audio capture in the system.
|
private |
Initializes NAudio WaveIn and WaveOut used to capture and reproduce audio.
|
private |
Initializes speex audio encoder and decoder.
|
private |
Handles PCM data segments captured by the active WaveIn instance.
sender | The publishing WaveIn instance |
e | WaveInEventArgs containing the captured audio |
|
private |
Plays a wave file using a new SoundPlayer instance.
audio | Audio in wave format |
|
private |
Handles incoming speex audio segments. Decompresses them into PCM that is added into the bufferedWaveStream from which the active WaveOut instance reads and reproduces them.
speexData | Speex encoded audio |
originatingLength | The count of 16 bit PCM samples that were encoded to produce the provided encoded data |
|
private |
Handles incoming media received by the active Connection instance over the WCF TCP channel. Supported formats are jpg images and wave audio fragments with pcm payload.
sender | Connection instance publishing the event |
info | MediaInformationDto describing the media data |
data | Media data payload |
|
private |
Handles incoming media received by the active Connection instance over the UDP channel. Supported formats are jpg images and speex encoded audio.
sender | Connection instance publishing the event |
mediaPacket | MediaPacket containing the media data and description |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
JpgImageReceived Hake_WPF.AudioVideoManagers.AudioVideoTransferManager.JpgImageReceivedEvent |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
getset |
Gets and sets UseOutGoingUdp.