Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on: [push, pull_request]

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Run rustfmt
run: cargo fmt --all --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Run clippy
run: cargo clippy --all-features

tests:
strategy:
matrix:
conf:
- tests
- bench-resampler
- bench-resampler-sse

env:
SPEEX_DIR: speex-dir

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Install speexdsp
run: |
git clone https://github.com/xiph/speexdsp.git
cd speexdsp
./autogen.sh
CONF=${{ matrix.conf }}
if [ ${CONF} = "bench-resampler" ]
then
./configure --disable-sse --prefix=$HOME/$SPEEX_DIR
else
./configure --prefix=$HOME/$SPEEX_DIR
fi
make -j4 install

- name: Set environment variables
run: |
echo PKG_CONFIG_PATH="$HOME/$SPEEX_DIR/lib/pkgconfig" >> $GITHUB_ENV
echo LD_LIBRARY_PATH="$HOME/$SPEEX_DIR/lib" >> $GITHUB_ENV

- name: Install stable
uses: dtolnay/rust-toolchain@stable

- name: Run benchmark
if: matrix.conf != 'tests'
run: |
cargo bench -q --features sys -- resampler_c
cargo bench -q -- resampler_rust

- name: Run no-default-features tests
if: matrix.conf == 'tests'
run: |
cargo test --all --no-default-features

- name: Run all-features tests
if: matrix.conf == 'tests'
run: |
cargo test --all --features "sse3 avx dynnative"
100 changes: 0 additions & 100 deletions .github/workflows/speexdsp.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "speexdsp-sys/speexdsp"]
path = speexdsp-sys/speexdsp
url = https://github.com/xiph/speexdsp
17 changes: 11 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[workspace]
members = ["speexdsp-sys", "resampler", "fft"]

[workspace.package]
edition = "2024"

[package]
name = "speexdsp"
version = "0.1.1"
Expand All @@ -9,13 +15,14 @@ keywords = ["audio", "resampler"]
categories = ["api-bindings"]
license = "MIT"
readme = "README.md"
edition = "2018"
edition.workspace = true

[features]
sys = ["speexdsp-sys"]
sse3 = [ "speexdsp-resampler/sse3" ]
avx = [ "speexdsp-resampler/avx" ]
dynnative = [ "speexdsp-resampler/dynnative" ]
vendored-sys = ["sys", "speexdsp-sys/vendored"]
sse3 = ["speexdsp-resampler/sse3"]
avx = ["speexdsp-resampler/avx"]
dynnative = ["speexdsp-resampler/dynnative"]

[dev-dependencies]
assert_approx_eq = "1.1.0"
Expand All @@ -28,8 +35,6 @@ criterion = "0.3"
speexdsp-sys = { version = "0.1.1", path = "speexdsp-sys", optional = true }
speexdsp-resampler = { version = "0.1", path = "resampler" }

[workspace]
members = ["speexdsp-sys", "resampler", "fft"]

[[bench]]
name = "resampling_c"
Expand Down
2 changes: 1 addition & 1 deletion benches/resampling_c.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(feature = "sys")]
extern crate speexdsp_sys;

use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};
#[cfg(feature = "sys")]
use speexdsp_sys::resampler::*;

Expand Down
2 changes: 1 addition & 1 deletion benches/resampling_rust.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::f32::consts::PI;

use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};
use speexdsp::resampler::*;

const PERIOD: f32 = 32f32;
Expand Down
2 changes: 1 addition & 1 deletion benches/resampling_simple_c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};

#[cfg(feature = "sys")]
use speexdsp_sys::resampler::*;
Expand Down
2 changes: 1 addition & 1 deletion benches/resampling_simple_c_dbl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};

#[cfg(feature = "sys")]
use speexdsp_sys::resampler::*;
Expand Down
2 changes: 1 addition & 1 deletion benches/resampling_simple_rust.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::f32::consts::PI;

use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};
use speexdsp::resampler::*;

const PERIOD: f32 = 32f32;
Expand Down
2 changes: 1 addition & 1 deletion benches/resampling_simple_rust_dbl.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::f32::consts::PI;

use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};
use speexdsp::resampler::*;

const PERIOD: f32 = 32f32;
Expand Down
15 changes: 9 additions & 6 deletions speexdsp-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ readme = "../README.md"
homepage = "https://github.com/rust-av/speexdsp-rs"
keywords = ["audio", "resampler"]
categories = ["api-bindings"]
edition.workspace = true

exclude = ["speexdsp/doc/*", "speexdsp/html/*"]

[features]
vendored = []

[build-dependencies]
autotools = "0.2"
system-deps = "6.0"
bindgen = "0.59.2"
pkg-config = "0.3"
bindgen = "0.72"
cc = "1"

[dev-dependencies]
byteorder = "1.3"
structopt = "0.3"

[package.metadata.system-deps]
speexdsp = "1.2"
Loading