https://github.com/audeering/audresamplelib
A C wrapper around soxr, for sample rate conversion.
https://github.com/audeering/audresamplelib
audio dsp remix resample soxr
Last synced: 8 months ago
JSON representation
A C wrapper around soxr, for sample rate conversion.
- Host: GitHub
- URL: https://github.com/audeering/audresamplelib
- Owner: audeering
- License: mit
- Created: 2020-12-16T12:44:25.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-18T07:46:09.000Z (over 2 years ago)
- Last Synced: 2024-04-18T03:25:58.459Z (about 2 years ago)
- Topics: audio, dsp, remix, resample, soxr
- Language: C
- Homepage:
- Size: 63.5 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# audresamplelib
A C wrapper around [soxr](https://sourceforge.net/projects/soxr/) for Sample
Rate Conversion (SRC).
## Build
The library is intended to be built via CMake, using Conan as a dependency manager.
For the Conan part, it is suggested to set up and activate a Python virtual environment:
```bash
virtualenv --python=python3 venv
source venv/bin/activate
```
Once the virtual environment is activated, install the `conan` package:
```bash
pip install conan
```
Then,
```bash
mkdir build
cd build
conan install ..
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TOOLS=ON
make
```
This will build both the wrapper library around `soxr` and two sample tools
(executables) for SRC, one based on the `audresample_oneshot()` function
(`src_oneshot`), the other based on the `audresample_process()` function, which
acts in a streaming fashion (`src_streaming`).
## Usage examples
The two sample executables (`src_oneshot` and `src_streaming`) are not really
meant for extensive use (even though they can be effectively used for SRC of wav
files), but their source code ([`src_oneshot.c`](src_oneshot.c) and
[`src_streaming.c`](src_streaming.c)) is rather meant to serve as usage examples
for the library API.
### Command line usage of the conversion tools
```
./src_oneshot
./src_streaming
```
As a result, a wav file will be written in the same folder as the input file,
having the same name but with a suffix indicating the new sample rate, e.g.,
`my-wav-file.wav` -> `my-wav-file.wav_sr8000Hz.wav`.