C# Class HCS_Encoder.Inputs.Buffers.AudioBufferMono

Inheritance: IEncoderBuffer
Show file Open project: i-e-b/HLS---Smooth-Encoder Class Usage Examples

Public Methods

Method Description
AudioBufferMono ( int SampleRate, int Channels ) : System

Prepare an audio frame buffer. Sample rate and channels should match INCOMING signal (from capture device). Always outputs 44.1kHz 16 bit PCM mono audio.

HandleCapturedSamples ( object sender, AudioDataEventArgs e ) : void

Respond to capture event. This should return as fast as possible.

LoadToFrame ( MediaFrame &Frame ) : void

Load the buffer into a MediaFrame for the encoder. IMPORTANT: You must call UnloadFrame after this method is called. For effciency, unload as soon as possible.

RebufferCapturedFrames ( ) : void

Not yet implemented.

RegisterPlugin ( IAudioProcessor PlugIn ) : void
RegisterPlugin ( IVideoProcessor PlugIn ) : void
UnloadFrame ( MediaFrame &Frame ) : void

Release memory previously locked by LoadToFrame()

WipeBuffer ( ) : void

Emergency frame drop. Removes all waiting samples.

WipeBufferUntil ( double AbandonTime ) : void

Private Methods

Method Description
MergeFirstSample ( ) : void

Join the first two samples together, making a large first sample. Resulting sample retains first sample's timecode.

PrependUnusedSamples ( MediaFrame Frame ) : void

Add unused samples back into the sample buffer.

Time stamps need to be properly re-integrated!

ResampleBuffer ( AudioDataEventArgs e, double sample_sec ) : short[]

Error based resampler. Only works for MONO.

ResampleStereo ( AudioDataEventArgs e, double sample_sec ) : short[]

Handles the more complex case of resampling interleaved stereo samples to mono

Method Details

AudioBufferMono() public method

Prepare an audio frame buffer. Sample rate and channels should match INCOMING signal (from capture device). Always outputs 44.1kHz 16 bit PCM mono audio.
public AudioBufferMono ( int SampleRate, int Channels ) : System
SampleRate int
Channels int
return System

HandleCapturedSamples() public method

Respond to capture event. This should return as fast as possible.
public HandleCapturedSamples ( object sender, AudioDataEventArgs e ) : void
sender object
e AudioDataEventArgs
return void

LoadToFrame() public method

Load the buffer into a MediaFrame for the encoder. IMPORTANT: You must call UnloadFrame after this method is called. For effciency, unload as soon as possible.
public LoadToFrame ( MediaFrame &Frame ) : void
Frame MediaFrame
return void

RebufferCapturedFrames() public method

Not yet implemented.
public RebufferCapturedFrames ( ) : void
return void

RegisterPlugin() public method

public RegisterPlugin ( IAudioProcessor PlugIn ) : void
PlugIn IAudioProcessor
return void

RegisterPlugin() public method

public RegisterPlugin ( IVideoProcessor PlugIn ) : void
PlugIn IVideoProcessor
return void

UnloadFrame() public method

Release memory previously locked by LoadToFrame()
public UnloadFrame ( MediaFrame &Frame ) : void
Frame MediaFrame
return void

WipeBuffer() public method

Emergency frame drop. Removes all waiting samples.
public WipeBuffer ( ) : void
return void

WipeBufferUntil() public method

public WipeBufferUntil ( double AbandonTime ) : void
AbandonTime double
return void