📄 classpsound.html
字号:
</tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the sample size in bits per sample.<p> </td> </tr></table><a name="z381_0" doxytag="PSound::Load"></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"> BOOL PSound::Load </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname1" valign="top" nowrap> <em>filename</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Load a platform dependent sound file (eg .WAV file for Win32) into the object. Note the whole file must able to be loaded into memory.<p>Also note that not all possible files are playable by this library. No format conversions between file and driver are performed.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound is loaded successfully. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>filename</em> </td><td>Sound file to load. </td></tr></table></dl> </td> </tr></table><a name="z379_2" doxytag="PSound::operator="></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"> PSound& PSound::operator= </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPBYTEArray.html">PBYTEArray</a> & </td> <td class="mdname1" valign="top" nowrap> <em>data</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set new data bytes for the sound. </td> </tr></table><a name="z383_0" doxytag="PSound::Play"></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"> BOOL PSound::Play </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Play the sound on the default sound device.<p> </td> </tr></table><a name="z385_0" doxytag="PSound::PlayFile"></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"> BOOL PSound::PlayFile </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname" nowrap> <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>BOOL </td> <td class="mdname" nowrap> <em>wait</em> = TRUE</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Play a sound file to the default device. If the wait# parameter is TRUE then the function does not return until the file has been played. If FALSE then the sound play is begun asynchronously and the function returns immediately.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound is playing or has played. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>wait</em> </td><td>Sound file to play. Flag to play sound synchronously. </td></tr></table></dl> </td> </tr></table><a name="z381_1" doxytag="PSound::Save"></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"> BOOL PSound::Save </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname1" valign="top" nowrap> <em>filename</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Save a platform dependent sound file (eg .WAV file for Win32) from the object.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the sound is saved successfully. </dl> </td> </tr></table><a name="z383_1" doxytag="PSound::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"> void PSound::SetFormat </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned </td> <td class="mdname" nowrap> <em>numChannels</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned </td> <td class="mdname" nowrap> <em>sampleRate</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned </td> <td class="mdname" nowrap> <em>bitsPerSample</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set the internal sound format to linear PCM at the specification in the parameters. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>bitsPerSample</em> </td><td>Samples per second Number of bits per sample </td></tr></table></dl> </td> </tr></table><hr><h2>Member Data Documentation</h2><a name="n4" doxytag="PSound::dwLastError"></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"> DWORD PSound::dwLastError<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Last error code for <a class="el" href="classPSound.html#z381_0">Load()</a>/<a class="el" href="classPSound.html#z381_1">Save()</a> functions.<p> </td> </tr></table><a name="n0" doxytag="PSound::encoding"></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"> unsigned PSound::encoding<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Format code.<p> </td> </tr></table><a name="n5" doxytag="PSound::formatInfo"></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"> <a class="el" href="classPBYTEArray.html">PBYTEArray</a> PSound::formatInfo<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Full info on the format (platform dependent).<p> </td> </tr></table><a name="n1" doxytag="PSound::numChannels"></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"> unsigned PSound::numChannels<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Number of channels eg mono/stereo.<p> </td> </tr></table><a name="n2" doxytag="PSound::sampleRate"></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"> unsigned PSound::sampleRate<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Samples per second.<p> </td> </tr></table><a name="n3" doxytag="PSound::sampleSize"></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"> unsigned PSound::sampleSize<code> [protected]</code> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Number of bits per sample.<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 + -