Operates an audio buffer.
Methods
BufferFrameChannelsAppend
Appends audio channels from buffer to a specified frame, the number of samples retrieved from specified frame
Syntax
void BufferFrameChannelsAppend( string _bsLine, MFFrame _pFrame, out int _plSamplesAppend, string _bsChannelsList )
Parameters
_bsLine - buffer's line
_pFrame - frame from audio channels will be appended
_plSamplesAppend - samples appended
_bsChannelsList - channels' list, for example "0,1,2,3"
BufferFrameFill
Reads audio from buffer to a frame.
If plSamples = 0 or NULL, then the audio duration calculated from frame rate, but no more than buffer size
if _nSamples < 0 then the audio duration calculated from frame rate and if there is not enough audio in the buffer, then the rest will be filled with silence
Syntax
void BufferFrameFill( string _bsLine, MFFrame _pFrame, out int _plSamples, string _bsChannelsList )
Parameters
_bsLine - buffer's line
_pFrame - frame to be filled from buffer
_plSamples - number of audio samples
_bsChannelsList - channels' list, for example "0,1,2,3"
BufferFrameMix
Mixes audio from buffer with specified frame, the number of samples retrieved from specified frame. Note: The audio can be insufficient. In this case use two lines for mixing.
Syntax
void BufferFrameMix( string _bsLineFrom, MFFrame _pFrameTo, out int _plSamplesMix, double _dblGainFromStartDb, double _dblGainFromEndDb, string _bsChannelsListIn, string _bsChannelsListOut )
Parameters
_bsLineFrom - buffer's line from which audio will be mixed
_pFrameTo - frame to which mixed audio will be implemented
_plSamplesMix - mixed samples
_dblGainFromStartDb - start gain in dB
_dblGainFromEndDb - end gain in dB
_bsChannelsListIn - input channels' list, for example "0,1,2,3"
_bsChannelsListOut - output channels' list, for example "0,2,1,3"
BufferFramePut
Puts audio from a frame to the buffer.
Syntax
void BufferFramePut( string _bsLine, MFFrame _pFrame, string _bsChannelsList )
Parameters
_bsLine - buffer's line
_pFrame - source frame
_bsChannelsList - channels' list, for example "0,1,2,3"
BufferGet
Get audio data from buffer. For planar format specify _cbAudioPlane: -1 auto size (from number of samples), 0 - interleaved. Note: if _ppAudio is NULL then allocate internal buffer, else copy to specified buffer.
Syntax
void BufferGet( string _bsLine, out int _plSamples, out long _ppbAudio, int _cbAudioPlane, string _bsChannelsList )
Parameters
_bsLine - buffer line to read the data
_plSamples - amount of audio samples in the buffer
_ppbAudio - pointer to audio data
_cbAudioPlane - specifies planar audio format
_bsChannelsList - channels list
BufferLinesMix
Mixes audio from buffer lines
Syntax
void BufferLinesMix( string _bsLineFrom, string _bsLineTo, out int _plSamplesMix, double _dblGainFromStartDb, double _dblGainFromEndDb, double _dblGainToStartDb, double _dblGainToEndDb, string _bsChannelsListIn, string _bsChannelsListOut )
Parameters
_bsLineFrom - line from which audio is mixed
_bsLineTo - line to which audio is mixed
_plSamplesMix - mixed samples
_dblGainFromStartDb - start gain in dB for "from" line
_dblGainFromEndDb - end gain in dB for "from" line
_dblGainToStartDb - start gain in dB for "to" line
_dblGainToEndDb - end gain in dB for "to" line
_bsChannelsListIn - list of input audio channels, for example "0,1,2,3"
_bsChannelsListOut - list of output audio channels, for example "0,3,2,1"
BufferLinesRemove
Removes line from buffer
Syntax
void BufferLinesRemove( string _bsLine )
Parameters
_bsLine - buffer's line
BufferLoadFromFile
Loads audio form file to a buffer.
Syntax
void BufferLoadFromFile( string _bsLine, string _bsFileName, int _lSamplesOffset, int _lSamplesLoad )
Parameters
_bsLine - buffer's line
_bsFileName - full path to a source file
_lSamplesOffset - samples offset
_lSamplesLoad - number of audio samples to be loaded. If _lSamplesLoad <= 0 then try to load whole file.
BufferPropsGet
Gets buffer's audio props
Syntax
void BufferPropsGet( string _bsLine, out M_AUD_PROPS _pAudProps, out int _plSamples )
Parameters
_bsLine - buffer's line
_pAudProps - audio properties
_plSamples - number of audio samples
BufferPropsSet
Sets buffer's audio properties
Syntax
void BufferPropsSet( string _bsLine, ref M_AUD_PROPS _pAudProps, int _bResetBuffer )
Parameters
_bsLine - buffer's line
_pAudProps - audio properties
_bResetBuffer - whether buffer will be reset ("1") or not ("0")
BufferPutPtr
Puts audio data to a buffer. If _pbAudio is NULL then the buffer is filled with silence
Syntax
void BufferPutPtr( string _bsLine, ref M_AUD_PROPS _pAudProps, int _lSamples, long _pbAudio, string _bsChannelsList )
Parameters
_bsLine - buffer's line
_pAudProps - audio properties
_lSamples - number of audio samples
_pbAudio - pointer to audio data
_bsChannelsList - channels' list, for example "0,1,2,3"
BufferPutPtrEx
Put audio data to buffer, also correct audio data by time (add silence or skip data), for planar format specify _cbAudioPlane: -1 auto size (from number of samples), 0 - interleaved
Syntax
void BufferPutPtrEx( string _bsLine, long _rtTime, ref M_AUD_PROPS _pAudProps, int _lSamples, long _pbAudio, int _cbAudioPlane, string _bsChannelsList )
Parameters
_bsLine - buffer line
_rtTime - reference time
_pAudProps - audio properties
_lSamples - amount of audio samples to put
_pbAudio - pointer to audio data to get audio from
_cbAudioPlane - planar data parameters
_bsChannelsList - channels list
BufferRemove
Removes audio data from the buffer
Syntax
void BufferRemove( string _bsLine, out int _plSamples )
Parameters
_bsLine - audio line
_plSamples - amount of audio samples to remove
BufferTimesEnable
Enable audio buffer times watching (e.g. for BufferFramePut, BufferFrameFill methods) and set max difference for times (if 0 then ONLY breaks are used)
Syntax
void BufferTimesEnable( string _bsLine, int _bEnable, long _prtMinDiff, long _prtMaxDiff )
Parameters
_bsLine - buffer line
_bEnable - enable (1) or disable (0) buffer times
_prtMinDiff - minimal difference
_prtMaxDiff - maximal difference
BufferTimesGet
Get audio buffer times (if any)
Syntax
void BufferTimesGet( string _bsLine, out long _prtStartTime, out long _prtEndTime )
Parameters
_bsLine - buffer line
_prtStartTime - start buffer time
_prtEndTime - end buffer time
BufferTimesIsEnabled
Indicates whether buffer times are enabled and shows differences values
Syntax
void BufferTimesIsEnabled( string _bsLine, out int _pbEnabled, out long _prtMinDiff, out long _prtMaxDiff )
Parameters
_bsLine - buffer line
_pbEnabled - 1 - times are enabled, 0 - times are disabled
_prtMinDiff - minimal difference
_prtMaxDiff - maximal difference
BufferTimesSet
Set audio buffer start/end time (remove or add audio if needed) Note: The rtEndTime ONLY for minimum time, if buffer end is greater then ignored.
Syntax
void BufferTimesSet( string _bsLine, long _rtStartTime, long _rtMinEndTime )
Parameters
_bsLine - buffer line
_rtStartTime - start time
_rtMinEndTime - end time