https://github.com/jcarrano/src.py
Python interface to libsamplerate
https://github.com/jcarrano/src.py
ctypes libsamplerate python python-bindings
Last synced: 9 months ago
JSON representation
Python interface to libsamplerate
- Host: GitHub
- URL: https://github.com/jcarrano/src.py
- Owner: jcarrano
- Created: 2013-11-11T00:30:31.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-12T00:38:36.000Z (about 12 years ago)
- Last Synced: 2025-02-01T20:11:35.851Z (11 months ago)
- Topics: ctypes, libsamplerate, python, python-bindings
- Language: Python
- Size: 109 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
================================
src.py: Libsamplerate for Python
================================
Description
-----------
This module provides a interface to libsamplerate (aka "Secret Rabbit Code").
The interface to libsamplerate was made with ctypes. Data input and outpus
happend over numpy arrays.
In contrast to most modules out there, this one implements the "Full API" of
libsamplerate. This allows to process data block by block and to change the
samplerate.
For more information, see: http://www.mega-nerd.com/SRC/api_full.html
Authors
-------
This code was written as part of of an assigment for the subject Voice
Processing, by
- Juan I Carrano
- Juan M Oxoby
- Marcelo Lerendegui
Usage
-----
You must have libsamplerate installed on you system.
Quick-start
~~~~~~~~~~~
- Create an instance of Resampler
- Call the process() method of the Resampler object in order to process data.
- src_reset and src_set_ratio are implemented as Resampler.reset and
Resampler.set_ratio respectively.
More
~~~~
There are three ways of using src.py
- Call process() repeteadly with blocks of data. When processing the last block
set the "end_of_input" keyword argument in process.
- Just like above, call process() repeteadly with blocks of data, but do not set
the "end_of_input" flag. After processing all blocks, call end_input to gather
any remaining output frames.
- Call process_iter() with an iterator yielding input blocks and an iterator
yielding resample ratios, or just a number specifying a fixed ratio.
process_iter() is a generator that will yield output blocks.
TODO
----
This code has not been yet tested on Windows.