Skip to main content

Room Impulse Response Generator for Python

Project description

Room Impulse Response Generator

Documentation Status CI Tests PyPI version Python versions DOI

Python- and C-based room impulse response generator, for use in convolutional reverb.

Official Python port of https://github.com/ehabets/RIR-Generator.

Installation

pip install rir-generator

Usage

import numpy as np
import scipy.signal as ss
import soundfile as sf
import rir_generator as rir

signal, fs = sf.read("bark.wav", always_2d=True)

h = rir.generate(
    c=340,                  # Sound velocity (m/s)
    fs=fs,                  # Sample frequency (samples/s)
    r=[                     # Receiver position(s) [x y z] (m)
        [2, 1.5, 1],
        [2, 1.5, 2],
        [2, 1.5, 3]
    ],
    s=[2, 3.5, 2],          # Source position [x y z] (m)
    L=[5, 4, 6],            # Room dimensions [x y z] (m)
    reverberation_time=0.4, # Reverberation time (s)
    nsample=4096,           # Number of output samples
)

print(h.shape)              # (4096, 3)
print(signal.shape)         # (11462, 2)

# Convolve 2-channel signal with 3 impulse responses
signal = ss.convolve(h[:, None, :], signal[:, :, None])

print(signal.shape)         # (15557, 2, 3)

Development

Installation for Development

git clone https://github.com/audiolabs/rir-generator.git
cd rir-generator
pip install -e .[dev]

Running Tests

pytest

Building from Source

python -m build

Project Structure

The project follows the src/ layout with automatic versioning from git tags:

src/
  rir_generator/
    __init__.py           # Main Python module
    _cffi/                # CFFI C++ extension bindings
      build.py            # CFFI build configuration
      rir_generator_core.cpp  # C++ implementation
      rir_generator_core.h    # C++ header

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rir_generator-0.3.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rir_generator-0.3.0-cp312-cp312-win_amd64.whl (20.6 kB view details)

Uploaded CPython 3.12Windows x86-64

rir_generator-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

rir_generator-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (17.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rir_generator-0.3.0-cp311-cp311-win_amd64.whl (20.6 kB view details)

Uploaded CPython 3.11Windows x86-64

rir_generator-0.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

rir_generator-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (17.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rir_generator-0.3.0-cp310-cp310-win_amd64.whl (20.6 kB view details)

Uploaded CPython 3.10Windows x86-64

rir_generator-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

rir_generator-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (17.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rir_generator-0.3.0-cp39-cp39-win_amd64.whl (20.6 kB view details)

Uploaded CPython 3.9Windows x86-64

rir_generator-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

rir_generator-0.3.0-cp39-cp39-macosx_11_0_arm64.whl (17.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

rir_generator-0.3.0-cp38-cp38-win_amd64.whl (20.5 kB view details)

Uploaded CPython 3.8Windows x86-64

rir_generator-0.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

rir_generator-0.3.0-cp38-cp38-macosx_11_0_arm64.whl (17.1 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file rir_generator-0.3.0.tar.gz.

File metadata

  • Download URL: rir_generator-0.3.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rir_generator-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aee1c90bdf702422c00a21379e021bb64af6ef2246aeccc571274468958876d4
MD5 fde1cc59fd14c401d533cb1af6b5abff
BLAKE2b-256 4beb3d6033ac7626fe6165dd6bbfafeb2661dac8c7da97c837c40253bd325a2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0.tar.gz:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 61f8384567944c27f19a4a4ddb5ae19689a32d27e25a505b10f677073fc07424
MD5 995dce5654b72b63551837bd7bd7de7b
BLAKE2b-256 ba79b6a0c68947a40fadefd2ac9d95b0ca8d2e0344402a40e42ad91a43243f02

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp312-cp312-win_amd64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b595fa8de553b9b151f361851418d3fcd446aa22f1c1af9564fe78c0c115e9c
MD5 473197cc5208970d4c2472cb663201fd
BLAKE2b-256 d99908d6175e603019ab568635ec6e90f85924cc17954bfa5a9772917ff2e721

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 058027a960e5378dad59c9e430380673fc283053e1d8c7a4b9a17a7cc1deedbf
MD5 bfda01be7dd9edd0ef91dcba913a8302
BLAKE2b-256 11aa0b9dd28675b00e8d22222784e8b3a1ca863c1a31082d6399c47a7c66f5f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ceb1664566fcdf8561f152cb5edd510189c1bef4464a98caaee9bbfb338aecdc
MD5 80101f9470ef2eee1189832fa9eb2a37
BLAKE2b-256 2f453c86e0c8a34fe9838bf19ac948845b4ee63c6fc998f83f0875ab39033c5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp311-cp311-win_amd64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b935827011ac424ddcd7cafd10a0db0ddd1798be8830f21949c1ba381098d67
MD5 638d6facb071bcbe8607544094d3e6c4
BLAKE2b-256 83d8965f8c9af7a0de21e909129d10c11b54d39fdf234a5bc1620a4646c6a5fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1f519d6f074c8ea0960bde7de159694d14e05c6bcd13ccabe2cbdab8a65ebc4
MD5 538d5c204a741101927c985098b0126f
BLAKE2b-256 428fec6f8cf4dc4738d523f1a2167cabc73e9fbff1d0b8131c9676a7c5368b7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 05597e250b761cfa810e50731b7e0736d09365ff5aa296e01ddebff63502d384
MD5 e86d971ca5e32987ff78beee5d04bfa6
BLAKE2b-256 a71b1f8dd4d31887323114b4a38b66b799368b39558e0e4ea9152fce791413b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp310-cp310-win_amd64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4578b0487e9634df5cf4c678b61692386e7673ac813abf6ee03e1fbc2851216
MD5 2b5d92fedaf34e84822aa8e38902ea23
BLAKE2b-256 4a7047a3843fb3d3cb5a887378073a5b30406f4c3962e3d043d856ae1728b1c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5adb0c98f72508e4e234afbaf8b17d0711ca691f0b3145b69a6de5a8b10042ea
MD5 ae0a7b5f520738564a3c1ab483f81be0
BLAKE2b-256 bf3d47ec60fd67ce927be39d1a15e4b1f3273845f41e97c9d408f20a3dfbb9fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9af9bdf746fa5c8f152b1d958ceebd14a791176e0b50a08c5524aa8d360b551c
MD5 8ea344e259db6071f93aad1eb5f3551d
BLAKE2b-256 5bd870bd75cdc563b006b4efe424a04441c54617ee80f2af06f38174c9fb02cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp39-cp39-win_amd64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b35dae151deeedea4eb0bcdaae2329efdb39f345cccab23eb99434afda63cbd3
MD5 8c0726c2a489930ebae4bf2975ed84fe
BLAKE2b-256 4b5f27f47d1648f3f0d757a8e40fcb8e7610f60fa3d3dfbc8ed6695be9786dbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bce8a80541d959d6ef7c8de228a3fb910d75fd6a3007067d28e0bcb24620cb41
MD5 f3446edd05cbbc04cff4ca1d52d7a5cc
BLAKE2b-256 e44d531dc62388c4ae4ea0b2480c22347a5ec7a157e9a40c9e9b9cfea4b824d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2b46787c5cc7a29952bccc5ffbf0961679343e4d4ff963ab71cace68cd5f6ec9
MD5 3742ce2138f04ee012db732ae701d451
BLAKE2b-256 07282c9151fcb028cc297a1e4677d496754a45c4fb568924f6e231fcb1ea0d24

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp38-cp38-win_amd64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2cb17cc807b445615460007f8180740232338769d9dd4d29466b9347268144c3
MD5 4dc69cade49fb70693f050bbd3d835af
BLAKE2b-256 21d94d339098112eb4dd0972031776cf741fa17aa13c65293ad2c6cb9b542fd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rir_generator-0.3.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rir_generator-0.3.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb97606aba35ba3d17abed97ed00bc4fbac53345658a97615e32c983c0f40889
MD5 ccf8f5003bc53e1d844328d24ad84e29
BLAKE2b-256 55ad1a2c25c1ac9268e0b34bee29a628a651cbbc8229cb7cd04a111f3440de93

See more details on using hashes here.

Provenance

The following attestation bundles were made for rir_generator-0.3.0-cp38-cp38-macosx_11_0_arm64.whl:

Publisher: publish-to-pypi.yml on audiolabs/rir-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page