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

33 lines
10 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>Playback options</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="ar01s16.html" title="Preprocessor options"><link rel="next" href="ar01s18.html" title="Accessing the voice buffer"></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">Playback options</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s16.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="ar01s18.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="playbackoptions"></a>Playback options</h2></div></div></div><p>Sound output can be configured using playback options. Currently the output value can be adjusted.</p><p>Playback options can be queried:
</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_getPlaybackConfigValueAsFloat</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">ident</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">result</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>uint64 <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>const char* <var class="pdparam">ident</var></code>;<br><code>float* <var class="pdparam">result</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434363760"></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 for which the playback option is queried.</p></li><li><p><em class="parameter"><code>ident</code></em></p><p>Identifier of the parameter to be configured. Possible values are:
</p><div class="itemizedlist"><ul type="circle"><li><p>&#8220;<span class="quote">volume_modifier</span>&#8221;</p><p>Modify the voice volume of other speakers. Value is in decibel, so 0 is no modification, negative values make the signal quieter and values greater than zero boost the signal louder than it is. Be careful with high positive values, as you can really cause bad audio quality due to clipping. The maximum possible Value is 30.</p><p>Zero and all negative values cannot cause clipping and distortion, and are preferred for optimal audio quality. Values greater than zero and less than +6 dB might cause moderate clipping and distortion, but should still be within acceptable bounds. Values greater than +6 dB will cause clipping and distortion that will negatively affect your audio quality. It is advised to choose lower values. Generally we recommend to not allow values higher than 15 db.</p><a class="indexterm" name="idm44835434356912"></a></li><li><p>&#8220;<span class="quote">volume_factor_wave</span>&#8221;</p><p>Adjust the volume of wave files played by <a class="link" href="ar01s19.html" title="Playing wave files"><code class="function">ts3client_playWaveFile</code></a> and <a class="link" href="ar01s19.html" title="Playing wave files"><code class="function">ts3client_playWaveFileHandle</code></a>. The value is a float defining the volume reduction in decibel. Reasonable values range from &#8220;<span class="quote">-40.0</span>&#8221; (very silent) to &#8220;<span class="quote">0.0</span>&#8221; (loudest).</p><a class="indexterm" name="idm44835434352288"></a></li></ul></div></li><li><p><em class="parameter"><code>result</code></em></p><p>Address of a variable that receives the playback configuration value as floating-point number.</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>To change playback options, 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_setPlaybackConfigValue</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">ident</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">value</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>uint64 <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>const char* <var class="pdparam">ident</var></code>;<br><code>const char* <var class="pdparam">value</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434343648"></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 for which the playback option is queried.</p></li><li><p><em class="parameter"><code>ident</code></em></p><p>Identifier of the parameter to be configured. The values are the same as in <code class="function">ts3client_getPlaybackConfigValueAsFloat</code> above.</p></li><li><p><em class="parameter"><code>value</code></em></p><p>String with the value to set the option to, encoded in UTF-8 format.</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="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>Playback options are tied to a playback device, so changing the values only makes sense after a device has been opened.</p></td></tr></table></div><p>Example code:</p><pre class="programlisting">unsigned int error;
float value;
if((error = ts3client_setPlaybackConfigValue(scHandlerID, "volume_modifier", "5.5")) != ERROR_ok) {
printf("Error setting playback config value: %d\n", error);
return;
}
if((error = ts3client_getPlaybackConfigValueAsFloat(scHandlerID, "volume_modifier", &amp;value)) != ERROR_ok) {
printf("Error getting playback config value: %d\n", error);
return;
}
printf("Volume modifier playback option: %f\n", value);</pre><div class="literallayout"><p><br>
</p></div><a name="setclientvolumemodifier"></a><p>In addition to changing the global voice volume modifier of all speakers by changing the &#8220;<span class="quote">volume_modifier</span>&#8221; parameter, voice volume of individual clients can be adjusted 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_setClientVolumeModifier</b>(</code></td><td><var class="pdparam">serverConnectionHandlerID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">clientID</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">value</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>uint64 <var class="pdparam">serverConnectionHandlerID</var></code>;<br><code>anyID <var class="pdparam">clientID</var></code>;<br><code>float <var class="pdparam">value</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
<a class="indexterm" name="idm44835434327888"></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 on which the client volume modifier should be adjusted.</p></li><li><p><em class="parameter"><code>clientID</code></em></p><p>ID of the client whose volume modifier should be adjusted.</p></li><li><p><em class="parameter"><code>value</code></em></p><p>The new client volume modifier value as float.</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>When calculating the volume for individual clients, both the global and client volume modifiers will be taken into account.</p><p>Client volume modifiers are valid as long as the specified client is visible. Once the client leaves visibility by joining an unsubscribed channel or disconnecting from the server, the client volume modifier will be lost. When the client enters visibility again, the modifier has to be set again by calling this function.</p><p>Example:</p><pre class="programlisting">
unsigned int error;
anyID clientID = 123;
float value = 10.0f;
if((error = ts3client_setClientVolumeModifier(scHandlerID, clientID, value)) != ERROR_ok) {
printf("Error setting client volume modifier: %d\n", error);
return;
}
</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ar01s16.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="ar01s18.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Preprocessor options </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"> Accessing the voice buffer</td></tr></table></div></body></html>