Libresample

From Audacity Wiki
(Difference between revisions)
Jump to: navigation, search
(basic description)
 
m (note that our libresample isn't the same as anyone else's.)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Resampling is the operation of converting from audio represented at one sampling rate to a representation at another sample rate with minimum losses.
+
{{Intro|1=Resampling is the operation of converting from audio represented at one [[Sample Rates|sample rate]] to a representation at another sample rate with minimum losses. '''Libresample''' is Audacity's implementation of the sinc function resampling algorithm, originally produced by Dominic Mazzoni based on Julius Smith's code at Stanford. The interface is very similar to Erik de Castro Lopo's {{external|[http://www.mega-nerd.com/SRC/ libsamplerate]}}, or SRC.|2=}}
  
libresample is audacity's implementation of the sinc function resampling algorithm, orginally produced by Dominic Mazzoni based on Julius Smith's code at Stanford. The interface is very similar to Erik de Castro Lopo's [SRC http://www.mega-nerd.com/SRC/].
 
  
Why didn't we just use SRC? Basically it's all down to licensing. SRC and Audacity are both under the [GNU GPL http://www.gnu.org/copyleft/gpl.html], so there shouldn't be a problem. However, the GPL requires that all the other libraries that an application links against (and so depends on) must also be under compatible licenses. If audacity loads a bunch of non-free, non-open source VST plugins, does this break the GPL? We (the Audacity developers) don't think so because they are optional, run-time plugins. The FSF is not terribly clear on the issue, and Erik de Castro Lopo thinks it breaks the GPL.
+
Why didn't we just use SRC? Basically it's all down to licensing. SRC and Audacity are both under the GNU {{external|[http://www.gnu.org/copyleft/gpl.html General Public License]}} (GPL), so there shouldn't be a problem. However, the GPL requires that all the other libraries that an application links against (and so depends on) must also be under compatible licences. If Audacity loads a bunch of non-free, non-open source VST plug-ins, does this break the GPL? We (the Audacity developers) don't think so because they are optional, run-time plug-ins. The {{external|[http://www.fsf.org/ Free Software Foundation]}} who administer the GPL are not terribly clear on the issue, and Erik de Castro Lopo thinks it breaks the GPL.
  
It's his library, so we don't release versions of audacity with SRC. However if you are building audacity for Linux, where the chances of using a closed-source binary plugin are effectively nill, you can configure audacity to link against an external copy of SRC if you wish.
+
It's his library, so we don't release versions of Audacity with SRC. However if you are building audacity for Linux, where the chances of using a closed-source binary plug-in are very low, you can [[Developing_On_Linux#Optional_Packages|configure]] Audacity to link against an external copy of SRC if you wish.  
 +
 
 +
In principle it's possible to disable both libresample and libsamplerate, however because you then get a version of Audacity with no support for changing sample rates, it's not recommended. For a start, if you open a file created with a sample rate that your sound card doesn't support, then you won't be able to play it back.
 +
 
 +
It's worth noting that although things called libresample crop up in various distributions and other packages (e.g. Asterisk), none of them are the same as what Audacity is using, although they all share common parentage. As a result we (Audacity) don't support or test linking to any of these libraries.
 +
 
 +
[[Category:For Developers]]

Revision as of 11:36, 28 December 2009

Resampling is the operation of converting from audio represented at one sample rate to a representation at another sample rate with minimum losses. Libresample is Audacity's implementation of the sinc function resampling algorithm, originally produced by Dominic Mazzoni based on Julius Smith's code at Stanford. The interface is very similar to Erik de Castro Lopo's libsamplerate , or SRC.


Why didn't we just use SRC? Basically it's all down to licensing. SRC and Audacity are both under the GNU General Public License  (GPL), so there shouldn't be a problem. However, the GPL requires that all the other libraries that an application links against (and so depends on) must also be under compatible licences. If Audacity loads a bunch of non-free, non-open source VST plug-ins, does this break the GPL? We (the Audacity developers) don't think so because they are optional, run-time plug-ins. The Free Software Foundation  who administer the GPL are not terribly clear on the issue, and Erik de Castro Lopo thinks it breaks the GPL.

It's his library, so we don't release versions of Audacity with SRC. However if you are building audacity for Linux, where the chances of using a closed-source binary plug-in are very low, you can configure Audacity to link against an external copy of SRC if you wish.

In principle it's possible to disable both libresample and libsamplerate, however because you then get a version of Audacity with no support for changing sample rates, it's not recommended. For a start, if you open a file created with a sample rate that your sound card doesn't support, then you won't be able to play it back.

It's worth noting that although things called libresample crop up in various distributions and other packages (e.g. Asterisk), none of them are the same as what Audacity is using, although they all share common parentage. As a result we (Audacity) don't support or test linking to any of these libraries.

Personal tools