1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>audioresample: GStreamer Base Plugins 1.0 Plugins Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-base Elements"> 9<link rel="prev" href="gst-plugins-base-plugins-audiorate.html" title="audiorate"> 10<link rel="next" href="gst-plugins-base-plugins-audiotestsrc.html" title="audiotestsrc"> 11<meta name="generator" content="GTK-Doc V1.28 (XML mode)"> 12<link rel="stylesheet" href="style.css" type="text/css"> 13</head> 14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#gst-plugins-base-plugins-audioresample.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 19 <a href="#gst-plugins-base-plugins-audioresample.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> 20 <a href="#gst-plugins-base-plugins-audioresample.properties" class="shortcut">Properties</a></span> 21</td> 22<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 23<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 24<td><a accesskey="p" href="gst-plugins-base-plugins-audiorate.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 25<td><a accesskey="n" href="gst-plugins-base-plugins-audiotestsrc.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 26</tr></table> 27<div class="refentry"> 28<a name="gst-plugins-base-plugins-audioresample"></a><div class="titlepage"></div> 29<div class="refnamediv"><table width="100%"><tr> 30<td valign="top"> 31<h2><span class="refentrytitle"><a name="gst-plugins-base-plugins-audioresample.top_of_page"></a>audioresample</span></h2> 32<p>audioresample</p> 33</td> 34<td class="gallery_image" valign="top" align="right"></td> 35</tr></table></div> 36<div class="refsect1"> 37<a name="gst-plugins-base-plugins-audioresample.properties"></a><h2>Properties</h2> 38<div class="informaltable"><table class="informaltable" border="0"> 39<colgroup> 40<col width="150px" class="properties_type"> 41<col width="300px" class="properties_name"> 42<col width="200px" class="properties_flags"> 43</colgroup> 44<tbody> 45<tr> 46<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> 47<td class="property_name"><a class="link" href="gst-plugins-base-plugins-audioresample.html#GstAudioResample--quality" title="The “quality” property">quality</a></td> 48<td class="property_flags">Read / Write / Construct</td> 49</tr> 50<tr> 51<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td> 52<td class="property_name"><a class="link" href="gst-plugins-base-plugins-audioresample.html#GstAudioResample--sinc-filter-auto-threshold" title="The “sinc-filter-auto-threshold” property">sinc-filter-auto-threshold</a></td> 53<td class="property_flags">Read / Write</td> 54</tr> 55<tr> 56<td class="property_type"><a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioResamplerFilterMode"><span class="type">GstAudioResamplerFilterMode</span></a></td> 57<td class="property_name"><a class="link" href="gst-plugins-base-plugins-audioresample.html#GstAudioResample--sinc-filter-mode" title="The “sinc-filter-mode” property">sinc-filter-mode</a></td> 58<td class="property_flags">Read / Write</td> 59</tr> 60<tr> 61<td class="property_type"><a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioResamplerMethod"><span class="type">GstAudioResamplerMethod</span></a></td> 62<td class="property_name"><a class="link" href="gst-plugins-base-plugins-audioresample.html#GstAudioResample--resample-method" title="The “resample-method” property">resample-method</a></td> 63<td class="property_flags">Read / Write</td> 64</tr> 65<tr> 66<td class="property_type"><a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioResamplerFilterInterpolation"><span class="type">GstAudioResamplerFilterInterpolation</span></a></td> 67<td class="property_name"><a class="link" href="gst-plugins-base-plugins-audioresample.html#GstAudioResample--sinc-filter-interpolation" title="The “sinc-filter-interpolation” property">sinc-filter-interpolation</a></td> 68<td class="property_flags">Read / Write</td> 69</tr> 70</tbody> 71</table></div> 72</div> 73<a name="GstAudioResample"></a><div class="refsect1"> 74<a name="gst-plugins-base-plugins-audioresample.other"></a><h2>Types and Values</h2> 75<div class="informaltable"><table class="informaltable" width="100%" border="0"> 76<colgroup> 77<col width="150px" class="name"> 78<col class="description"> 79</colgroup> 80<tbody><tr> 81<td class="datatype_keyword">struct</td> 82<td class="function_name"><a class="link" href="gst-plugins-base-plugins-audioresample.html#GstAudioResample-struct" title="struct GstAudioResample">GstAudioResample</a></td> 83</tr></tbody> 84</table></div> 85</div> 86<div class="refsect1"> 87<a name="gst-plugins-base-plugins-audioresample.object-hierarchy"></a><h2>Object Hierarchy</h2> 88<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> 89 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> 90 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a> 91 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a> 92 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseTransform.html#GstBaseTransform-struct">GstBaseTransform</a> 93 <span class="lineart">╰──</span> GstAudioResample 94</pre> 95</div> 96<div class="refsect1"> 97<a name="gst-plugins-base-plugins-audioresample.description"></a><h2>Description</h2> 98<p>audioresample resamples raw audio buffers to different sample rates using 99a configurable windowing function to enhance quality.</p> 100<p>By default, the resampler uses a reduced sinc table, with cubic interpolation filling in 101the gaps. This ensures that the table does not become too big. However, the interpolation 102increases the CPU usage considerably. As an alternative, a full sinc table can be used. 103Doing so can drastically reduce CPU usage (4x faster with 44.1 -> 48 kHz conversions for 104example), at the cost of increased memory consumption, plus the sinc table takes longer 105to initialize when the element is created. A third mode exists, which uses the full table 106unless said table would become too large, in which case the interpolated one is used instead.</p> 107<div class="refsect3"> 108<a name="id-1.2.12.7.4"></a><h4>Example launch line</h4> 109<div class="informalexample"> 110 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 111 <tbody> 112 <tr> 113 <td class="listing_lines" align="right"><pre>1</pre></td> 114 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v uridecodebin uri<span class="gtkdoc opt">=</span>file<span class="gtkdoc opt">:</span><span class="gtkdoc slc">///path/to/audio.ogg ! audioconvert ! audioresample ! audio/x-raw, rate=8000 ! autoaudiosink</span></pre></td> 115 </tr> 116 </tbody> 117 </table> 118</div> 119 120<p> 121 Decode an audio file and downsample it to 8Khz and play sound. 122To create the Ogg/Vorbis file refer to the documentation of vorbisenc. 123This assumes there is an audio sink that will accept/handle 8kHz audio.</p> 124</div> 125<div class="refsynopsisdiv"> 126<h2>Synopsis</h2> 127<div class="refsect2"> 128<a name="id-1.2.12.7.5.1"></a><h3>Element Information</h3> 129<div class="variablelist"><table border="0" class="variablelist"> 130<colgroup> 131<col align="left" valign="top"> 132<col> 133</colgroup> 134<tbody> 135<tr> 136<td><p><span class="term">plugin</span></p></td> 137<td> 138 <a class="link" href="gst-plugins-base-plugins-plugin-audioresample.html#plugin-audioresample">audioresample</a> 139 </td> 140</tr> 141<tr> 142<td><p><span class="term">author</span></p></td> 143<td>Sebastian Dröge <sebastian.droege@collabora.co.uk></td> 144</tr> 145<tr> 146<td><p><span class="term">class</span></p></td> 147<td>Filter/Converter/Audio</td> 148</tr> 149</tbody> 150</table></div> 151</div> 152<hr> 153<div class="refsect2"> 154<a name="id-1.2.12.7.5.2"></a><h3>Element Pads</h3> 155<div class="variablelist"><table border="0" class="variablelist"> 156<colgroup> 157<col align="left" valign="top"> 158<col> 159</colgroup> 160<tbody> 161<tr> 162<td><p><span class="term">name</span></p></td> 163<td>sink</td> 164</tr> 165<tr> 166<td><p><span class="term">direction</span></p></td> 167<td>sink</td> 168</tr> 169<tr> 170<td><p><span class="term">presence</span></p></td> 171<td>always</td> 172</tr> 173<tr> 174<td><p><span class="term">details</span></p></td> 175<td>audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved }</td> 176</tr> 177</tbody> 178</table></div> 179<div class="variablelist"><table border="0" class="variablelist"> 180<colgroup> 181<col align="left" valign="top"> 182<col> 183</colgroup> 184<tbody> 185<tr> 186<td><p><span class="term">name</span></p></td> 187<td>src</td> 188</tr> 189<tr> 190<td><p><span class="term">direction</span></p></td> 191<td>source</td> 192</tr> 193<tr> 194<td><p><span class="term">presence</span></p></td> 195<td>always</td> 196</tr> 197<tr> 198<td><p><span class="term">details</span></p></td> 199<td>audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved }</td> 200</tr> 201</tbody> 202</table></div> 203</div> 204</div> 205</div> 206<div class="refsect1"> 207<a name="gst-plugins-base-plugins-audioresample.functions_details"></a><h2>Functions</h2> 208<p></p> 209</div> 210<div class="refsect1"> 211<a name="gst-plugins-base-plugins-audioresample.other_details"></a><h2>Types and Values</h2> 212<div class="refsect2"> 213<a name="GstAudioResample-struct"></a><h3>struct GstAudioResample</h3> 214<pre class="programlisting">struct GstAudioResample;</pre> 215<p>Opaque data structure.</p> 216</div> 217</div> 218<div class="refsect1"> 219<a name="gst-plugins-base-plugins-audioresample.property-details"></a><h2>Property Details</h2> 220<div class="refsect2"> 221<a name="GstAudioResample--quality"></a><h3>The <code class="literal">“quality”</code> property</h3> 222<pre class="programlisting"> “quality” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></pre> 223<p>Resample quality with 0 being the lowest and 10 being the best.</p> 224<p>Flags: Read / Write / Construct</p> 225<p>Allowed values: [0,10]</p> 226<p>Default value: 4</p> 227</div> 228<hr> 229<div class="refsect2"> 230<a name="GstAudioResample--sinc-filter-auto-threshold"></a><h3>The <code class="literal">“sinc-filter-auto-threshold”</code> property</h3> 231<pre class="programlisting"> “sinc-filter-auto-threshold” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></pre> 232<p>Memory usage threshold to use if sinc filter mode is AUTO, given in bytes.</p> 233<p>Flags: Read / Write</p> 234<p>Default value: 1048576</p> 235</div> 236<hr> 237<div class="refsect2"> 238<a name="GstAudioResample--sinc-filter-mode"></a><h3>The <code class="literal">“sinc-filter-mode”</code> property</h3> 239<pre class="programlisting"> “sinc-filter-mode” <a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioResamplerFilterMode"><span class="type">GstAudioResamplerFilterMode</span></a></pre> 240<p>What sinc filter table mode to use.</p> 241<p>Flags: Read / Write</p> 242<p>Default value: GST_AUDIO_RESAMPLER_FILTER_MODE_AUTO</p> 243</div> 244<hr> 245<div class="refsect2"> 246<a name="GstAudioResample--resample-method"></a><h3>The <code class="literal">“resample-method”</code> property</h3> 247<pre class="programlisting"> “resample-method” <a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioResamplerMethod"><span class="type">GstAudioResamplerMethod</span></a></pre> 248<p>What resample method to use.</p> 249<p>Flags: Read / Write</p> 250<p>Default value: GST_AUDIO_RESAMPLER_METHOD_KAISER</p> 251</div> 252<hr> 253<div class="refsect2"> 254<a name="GstAudioResample--sinc-filter-interpolation"></a><h3>The <code class="literal">“sinc-filter-interpolation”</code> property</h3> 255<pre class="programlisting"> “sinc-filter-interpolation” <a href="../html/gst-plugins-base-libs-GstAudio.html#GstAudioResamplerFilterInterpolation"><span class="type">GstAudioResamplerFilterInterpolation</span></a></pre> 256<p>How to interpolate the sinc filter table.</p> 257<p>Flags: Read / Write</p> 258<p>Default value: GST_AUDIO_RESAMPLER_FILTER_INTERPOLATION_CUBIC</p> 259</div> 260</div> 261</div> 262<div class="footer"> 263<hr>Generated by GTK-Doc V1.28</div> 264</body> 265</html>