Files
TS_WIFILED/docs/client_html/ar01s19.html
2020-04-04 17:21:07 +02:00

14 lines
8.5 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Playing wave files</title><link rel="stylesheet" href="ts3doc.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="TeamSpeak 3 Client SDK Developer Manual"><link rel="up" href="index.html" title="TeamSpeak 3 Client SDK Developer Manual"><link rel="prev" href="ar01s18.html" title="Accessing the voice buffer"><link rel="next" href="ar01s20.html" title="3D Sound"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><img id="logo" src="images/logo.png"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Playing wave files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s18.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ar01s20.html"><img src="images/next.png" alt="Next"></a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="wavefiles"></a>Playing wave files</h2></div></div></div><p>The TeamSpeak Client Lib offers support to play wave files from the local harddisk.</p><p>To play a local wave file, call
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">unsigned int <b class="fsfunc">ts3client_playWaveFile</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">path</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>anyID <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>const char* <var class="pdparam">path</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434217456"></a></p><div class="itemizedlist"><ul type="disc"><li><p><em class="parameter"><code>serverConnectionHandlerID</code></em></p><p>ID of the server connection handler defining which playback device is to be used to play the sound file.</p></li><li><p><em class="parameter"><code>path</code></em></p><p>Local filepath of the sound file in WAV format to be played, encoded in UTF-8.</p></li></ul></div><p>Returns <em class="structfield"><code>ERROR_ok</code></em> on success, otherwise an error code as defined in <code class="filename">public_errors.h</code>.</p><p>This is the simple version of playing a sound file. It's a fire-and-forget mechanism, this function will not block.</p><div class="literallayout"><p><br>
</p></div><p>The more complex version is to play an optionally looping sound and obtain a handle, which can be used to pause, unpause and stop the loop.
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">unsigned int <b class="fsfunc">ts3client_playWaveFileHandle</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">path</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">loop</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">waveHandle</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>anyID <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>const char* <var class="pdparam">path</var></code>;<br><code>int <var class="pdparam">loop</var></code>;<br><code>uint64* <var class="pdparam">waveHandle</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434205616"></a></p><div class="itemizedlist"><ul type="disc"><li><p><em class="parameter"><code>serverConnectionHandlerID</code></em></p><p>ID of the server connection handler defining which playback device is to be used to play the sound file.</p></li><li><p><em class="parameter"><code>path</code></em></p><p>Local filepath of the sound file in WAV format to be played, encoded in UTF-8.</p></li><li><p><em class="parameter"><code>loop</code></em></p><p>If set to 1, the sound will be looping until the handle is paused or closed.</p></li><li><p><em class="parameter"><code>waveHandle</code></em></p><p>Memory address of a variable in which the handle is written. Use this handle to call <code class="function">ts3client_pauseWaveFileHandle</code> and <code class="function">ts3client_closeWaveFileHandle</code>.</p></li></ul></div><p>Returns <em class="structfield"><code>ERROR_ok</code></em> on success, otherwise an error code as defined in <code class="filename">public_errors.h</code>. If an error occured, <em class="parameter"><code>waveHandle</code></em> is uninitialized and must not be used.</p><div class="literallayout"><p><br>
</p></div><p>Using the handle obtained by <code class="function">ts3client_playWaveFileHandle</code>, sounds can be paused and unpaused with
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">unsigned int <b class="fsfunc">ts3client_pauseWaveFileHandle</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">waveHandle</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">pause</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>anyID <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>uint64 <var class="pdparam">waveHandle</var></code>;<br><code>int <var class="pdparam">pause</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434189568"></a></p><div class="itemizedlist"><ul type="disc"><li><p><em class="parameter"><code>serverConnectionHandlerID</code></em></p><p>ID of the server connection handler defining which playback device is to be used to play the sound file.</p></li><li><p><em class="parameter"><code>waveHandle</code></em></p><p>Wave handle obtained by <code class="function">ts3client_playWaveFileHandle</code>.</p></li><li><p><em class="parameter"><code>pause</code></em></p><p>If set to 1, the sound will be paused. Set to 0 to unpause.</p></li></ul></div><p>Returns <em class="structfield"><code>ERROR_ok</code></em> on success, otherwise an error code as defined in <code class="filename">public_errors.h</code>.</p><div class="literallayout"><p><br>
</p></div><p>Using the handle obtained by <code class="function">ts3client_playWaveFileHandle</code>, sounds can be closed with
</p><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">unsigned int <b class="fsfunc">ts3client_closeWaveFileHandle</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">waveHandle</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>anyID <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>uint64 <var class="pdparam">waveHandle</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434177216"></a></p><div class="itemizedlist"><ul type="disc"><li><p><em class="parameter"><code>serverConnectionHandlerID</code></em></p><p>ID of the server connection handler defining which playback device is to be used to play the sound file.</p></li><li><p><em class="parameter"><code>waveHandle</code></em></p><p>Wave handle obtained by <code class="function">ts3client_playWaveFileHandle</code>.</p></li></ul></div><p>Returns <em class="structfield"><code>ERROR_ok</code></em> on success, otherwise an error code as defined in <code class="filename">public_errors.h</code>.</p><div class="literallayout"><p><br>
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ar01s18.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ar01s20.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Accessing the voice buffer </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> 3D Sound</td></tr></table></div></body></html>