📄 classpsoundchannel.html
字号:
<td> </td> <td><p>Set the internal buffers for the sound channel I/O.<p>Note that with Linux OSS, the size is always rounded up to the nearest power of two, so 20000 => 32768.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound device is valid for playing/recording. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>count</em> </td><td>Size of each buffer Number of buffers </td></tr></table></dl> </td> </tr></table><a name="z391_1" doxytag="PSoundChannel::SetFormat"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::SetFormat </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned </td> <td class="mdname" nowrap> <em>numChannels</em> = 1, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned </td> <td class="mdname" nowrap> <em>sampleRate</em> = 8000, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned </td> <td class="mdname" nowrap> <em>bitsPerSample</em> = 16</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set the format for play/record. Note that linear PCM data is the only one supported at this time.<p>Note that if the <a class="el" href="classPSoundChannel.html#z393_3">PlayFile()</a> function is used, this may be overridden by information in the file being played.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the format is valid. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>sampleRate</em> </td><td>Number of channels eg mono/stereo </td></tr><tr><td valign=top><em>bitsPerSample</em> </td><td>Samples per second Number of bits per sample </td></tr></table></dl> </td> </tr></table><a name="z391_7" doxytag="PSoundChannel::SetVolume"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::SetVolume </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned </td> <td class="mdname1" valign="top" nowrap> <em>volume</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set the volume of the play/read process. The volume range is 0 == quiet. 100 == LOUD.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if there were no errors. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>volume</em> </td><td>New volume level </td></tr></table></dl> </td> </tr></table><a name="z395_4" doxytag="PSoundChannel::StartRecording"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::StartRecording </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Start filling record buffers. The first call to <a class="el" href="classPSoundChannel.html#z395_0">Read()</a> will also initiate the recording.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound driver has successfully started recording. </dl> </td> </tr></table><a name="z395_8" doxytag="PSoundChannel::WaitForAllRecordBuffersFull"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::WaitForAllRecordBuffersFull </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Block the thread until all of the record buffer allocated has been filled. There is an implicit <a class="el" href="classPSoundChannel.html#z389_3">Abort()</a> of the recording if this occurs and recording is stopped. The channel may need to be closed and opened again to start a new recording.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound driver has filled a buffer. </dl> </td> </tr></table><a name="z393_5" doxytag="PSoundChannel::WaitForPlayCompletion"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::WaitForPlayCompletion </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Block the thread until the sound play begun with PlayBuffer() or <a class="el" href="classPSoundChannel.html#z393_3">PlayFile()</a> has completed.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound has successfully completed playing. </dl> </td> </tr></table><a name="z395_7" doxytag="PSoundChannel::WaitForRecordBufferFull"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::WaitForRecordBufferFull </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Block the thread until a record buffer has been filled, so that the next <a class="el" href="classPSoundChannel.html#z395_0">Read()</a> call will not block. Provided that the amount of data read is less than the buffer size.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound driver has filled a buffer. </dl> </td> </tr></table><a name="z393_0" doxytag="PSoundChannel::Write"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSoundChannel::Write </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const void * </td> <td class="mdname" nowrap> <em>buf</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>PINDEX </td> <td class="mdname" nowrap> <em>len</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Low level write (or play) to the channel. This function will block until the requested number of characters are written or the write timeout is reached. The <a class="el" href="classPSoundChannel.html#z393_1">GetLastWriteCount()</a> function returns the actual number of bytes written.<p>The <a class="el" href="classPChannel.html#z55_2">GetErrorCode()</a> function should be consulted after <a class="el" href="classPSoundChannel.html#z393_0">Write()</a> returns FALSE to determine what caused the failure.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if at least len bytes were written to the channel. </dl><p>Reimplemented from <a class="el" href="classPChannel.html#z51_2">PChannel</a>. </td> </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PSoundChannel::baseChannel"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PSoundChannel* PSoundChannel::baseChannel<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr>The documentation for this class was generated from the following file:<ul><li><a class="el" href="sound_8h-source.html">sound.h</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:19 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -