📄 vc25pro_doc_unamsacmclasses.html
字号:
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.formatChooseDef(var format: pWAVEFORMATEX): MMRESULT;</SPAN><P />
Default implementation of format choosing routine.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.getErrorText(errorCode: MMRESULT): string;</SPAN><P />
Returns error message text corresponding to given errorCode parameter.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.chunkSize: unsigned;</SPAN><P />
Size in bytes of internal buffer used to handle the audio stream data.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.chunkPerSecond: unsigned;</SPAN><P />
Specifies number of chunks produced by component per second.
Note, that not all components are working in real time, in which case this property has no meaning.
Readonly property, change the global c_defChunksPerSecond variable if you wish to change this number.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.calcVolume: bool;</SPAN><P />
Specifies whether volume level calculation should be performed.
Set to true if planning to use silence detection when silenceDetectionMode is set to unasdm_VC.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.inBytes: int64;</SPAN><P />
Number of bytes passed to device (as input). Playback and codec devices increase this value.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.outBytes: int64;</SPAN><P />
Number of bytes produced by device (as output). Recording and codec devices increase this value.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.srcFormat: pWAVEFORMATEX;</SPAN><P />
Returns source format for device.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.dstFormat: pWAVEFORMATEX;</SPAN><P />
Returns destination format for device.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.srcFormatInfo: string;</SPAN><P />
Returns string representation of source format.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.dstFormatInfo: string;</SPAN><P />
Returns string representation of destination wave format.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.dataEvent: unaEvent;</SPAN><P />
This event is set to signaled state every time new data was produced by device.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.inProgress: unsigned;</SPAN><P />
Number of chunks passed to Windows ACM or wave device.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.realTime: bool;</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.dataInEvent: unaEvent;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.overNumIn: unsigned;</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.inOverloadTotal: int64;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.overNumOut: unsigned;</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.outOverloadTotal: int64;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.flushBeforeClose: bool;</SPAN><P />
Specifies whether component will flush unfinished data before closing.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.minVolumeLevel: unsigned;</SPAN><P />
Specifies the minimum value of volume level for silence detection.
Has meaning only when silenceDetectionMode is set to unasdm_VC.
<BR />Set this property to 0 to disable the volume detection feature.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.minActiveTime: unsigned;</SPAN><P />
Specifies the minimum amount of time (in milliseconds) for silence detection to be active once activated.
Has meaning only when silenceDetectionMode is set to unasdm_VC.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.isSilence: bool;</SPAN><P />
Returns true if components is currently not producing any audio chunks due to low signal level.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.silenceDetectionMode: unaWaveInSDMehtods;</SPAN><P />
Specifies which method will be used to detect silence.
<UL>
<LI>unasdm_none - no silence detection</LI>
<LI>unasdm_VC - "old" method, which uses minVolumeLevel and minActiveTime</LI>
<LI>unasdm_DSP</LI>
<UL>
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.onThreshold: unaWaveInOnThresholdEvent;</SPAN><P />
This event is fired when current level of a signal is crossing specified threshold.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>.onDataAvailable: unaWaveDataEvent;</SPAN><P />
This event is called when new data is available.
</TD></TR></TABLE></DIV>
<DIV><P /><H4>Class <A NAME="class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>(<A HREF="#class_unaMsAcmDeviceHeader"><SPAN class="class">unaMsAcmDeviceHeader</SPAN></A>)</H4><P />
This class stores the data used by MS ACM codec.
<P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.getStatus(index: int): bool; override;</SPAN><P />
Used to return different statuses of header.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.setStatus(index: int; value: bool); override;</SPAN><P />
Used to set different statuses of header.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.isDoneHeader(): bool; override;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.isInQueue(): bool; override;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.rePrepare(); override;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">constructor <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.create(codec: <A HREF="#class_unaMsAcmCodec"><SPAN class="class">unaMsAcmCodec</SPAN></A>; srcSize: unsigned; dstSize: unsigned);</SPAN><P />
Creates ACM codec header and allocates required buffers.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">destructor <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.Destroy(); override;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.write(data: pointer; size: unsigned; offset: unsigned = 0);</SPAN><P />
Writes data to the source codec buffer.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.isDone: bool;</SPAN><P />
Returns true if header is released by codec.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.inQueue: bool;</SPAN><P />
Returns true if header is still in codec queue.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaMsAcmCodecHeader"><SPAN class="class">unaMsAcmCodecHeader</SPAN></A>.isPrepared: bool;</SPAN><P />
Returns true if header was prepared.
</TD></TR></TABLE></DIV>
<DIV><P /><H4>Class <A NAME="class_unaMsAcmCodec"><SPAN class="class">unaMsAcmCodec</SPAN></A>(<A HREF="#class_unaMsAcmStreamDevice"><SPAN class="class">unaMsAcmStreamDevice</SPAN></A>)</H4><P />
This class is wrapper over Windows Multimedia streams API. Create it specifying the driver you wish to use with the stream.
You can get list of available drivers from unaMsAcm class instance.
<P />Codec usually takes source (input) stream, converts it into another wave format, and produces destination (output) stream.
Before opening the codec you should specify source and destination formats using the setFormat() method.
isSrc parameter is true for source format and false for destination. tag and index are specific for selected driver.
<P />For example, Microsoft PCM Converter driver has tag = 1 and index specifies sampling parameters.
So, if you specify tag=1, index=1 as source and tag=1, index=9 as destination, codec will convert 8,000 kHz; 8 Bit; stereo PCM stream into 22,050 kHz; 8 Bit; stereo PCM stream.
You can easily enumerate all formats supported by specific driver using the unaMsAcmDriver.enumFormats() method.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -