C# Class HCS_Encoder.Inputs.Buffers.AudioBufferMono

Inheritance: IEncoderBuffer
Afficher le fichier Open project: i-e-b/HLS---Smooth-Encoder Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat System

HandleCapturedSamples() public méthode

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

LoadToFrame() public méthode

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
Résultat void

RebufferCapturedFrames() public méthode

Not yet implemented.
public RebufferCapturedFrames ( ) : void
Résultat void

RegisterPlugin() public méthode

public RegisterPlugin ( IAudioProcessor PlugIn ) : void
PlugIn IAudioProcessor
Résultat void

RegisterPlugin() public méthode

public RegisterPlugin ( IVideoProcessor PlugIn ) : void
PlugIn IVideoProcessor
Résultat void

UnloadFrame() public méthode

Release memory previously locked by LoadToFrame()
public UnloadFrame ( MediaFrame &Frame ) : void
Frame MediaFrame
Résultat void

WipeBuffer() public méthode

Emergency frame drop. Removes all waiting samples.
public WipeBuffer ( ) : void
Résultat void

WipeBufferUntil() public méthode

public WipeBufferUntil ( double AbandonTime ) : void
AbandonTime double
Résultat void