A room impulse response simulator using for geometric sound propagation
Project description
Copyright (C) 2010-2020 Carl Schissler, University of North Carolina at Chapel Hill. All rights reserved.
pygsound
GSound is a physically-based sound propagation package used for acoustic simulations in various environments, developed by Dr Carl Schissler. pygsound is the Python package that wraps GSound's codebase for efficiently computing room impulse responses (RIRs) with specular and diffuse reflections. GSound is powerful enough to be used for sound simulation in 3D scenes with complicated geometry and acoustic materials. This repo's python API has not exposed all of GSound's components. But we do provide the complete C++ source code and welcome pull requests if you made useful modifications (mainly the python API).
Dependencies
On Linux, install dependencies using:
sudo apt-get update
sudo apt-get -y install libfftw3-dev
On MacOS, install dependencies using:
brew update
brew install fftw
Installation
Install from PyPI
pip install pygsound
If you have difficulty installing from PyPI on incompatible platforms, or if you want the most up-to-date changes, continue reading to install from source.
Install from source
This repo has been configured to build with CMake (version>=12), and mainly tested on Linux and MacOS.
First clone this repo with:
git clone --recurse-submodules https://github.com/GAMMA-UMD/pygsound.git
We assume you have python3 installed. Then you can build and test with
cd pygsound
python3 setup.py develop
python3 setup.py test
or directly install it as a python package with
cd pygsound
pip3 install .
Usage
See examples
folder (extra modules may be required). You need to cd examples
and run python3 mesh_sim.py
(we recommend starting with this one). This script demonstrates two equivalent ways to define the environment for sound propagation, and save the impulse response as an audio file. You can use a .obj
file with an optional .mtl
file with the same name to define the room geometry and materials. In this case, the .mtl
file has two extra rows compared with conventional .mtl
file used for visual rendering:
sound_a 0.5 0.6 0.6 0.7 0.75 0.8 0.9 0.9 # sound absorption coefficients, for 8 octave bands [62.5, 125, 250, 500, 1000, 2000, 4000, 8000]Hz
sound_s 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 # sound scattering coefficients, if you don't know the details of diffuse/specular reflections, keep it low
or directly create a shoebox shaped room using our API:
room = ps.createbox(dim_x, dim_y, dim_z, absorption_coefficient, scattering_coefficient)
The benefit of using the .obj
style is that you can easily define different reflection/absorption coefficients for each triangle element for each frequency sub-band.
Contact
This package is maintained by Zhenyu Tang. For code issues, please open new issues or join discussions in our github repo. For research related questions, please directly contact corresponding authors.
Citations
This sound propagation engine has been used for many research work of Dr Carl Schissler and other researchers in the UMD GAMMA group for audio rendering and impulse response generation purposes. For example:
@inproceedings{schissler2011gsound,
title={Gsound: Interactive sound propagation for games},
author={Schissler, Carl and Manocha, Dinesh},
booktitle={Audio Engineering Society Conference: 41st International Conference: Audio for Games},
year={2011},
organization={Audio Engineering Society}
}
@article{schissler2017interactive,
title={Interactive sound propagation and rendering for large multi-source scenes},
author={Schissler, Carl and Manocha, Dinesh},
journal={ACM Transactions on Graphics (TOG)},
volume={36},
number={1},
pages={2},
year={2017},
publisher={ACM}
}
@inproceedings{9052932,
author={Z. {Tang} and L. {Chen} and B. {Wu} and D. {Yu} and D. {Manocha}},
booktitle={ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
title={Improving Reverberant Speech Training Using Diffuse Acoustic Simulation},
year={2020},
volume={},
number={},
pages={6969-6973},
}
For a complete list of relevant work you may want to cite depending on how you use this repo, see our speech related research and sound related research.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pygsound-0.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb1dd4c4396e4a078ef54f047802ab4266fcf3a8be9109c075a09db1a5bafb43 |
|
MD5 | 9dfd30e8ef9e6d0171ac8914ac4f0ec6 |
|
BLAKE2b-256 | e4d6c7e1d989a1cd3858ab76c808d53e859066e1a4d030e79fb183e4a287524d |
Hashes for pygsound-0.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7b83c877d93657e5c258d801b0cf9caaa0608c39c46afb635b09021743cb175 |
|
MD5 | fa021061506c059c116a49051834f069 |
|
BLAKE2b-256 | a20f863a3054a97eea49c03e5d49ca9343597cb51cce14f12ed6f61a06a4bdfd |
Hashes for pygsound-0.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71f945b4e833c1c8004f492ab1d224b3c5007de44d7d3555794caa8f27bdf9be |
|
MD5 | 10019a343caa8099521d2960304e4034 |
|
BLAKE2b-256 | b6211bedb78e8b03e945edae5a17be5148f60da13f61aef44332ffba1a113d76 |
Hashes for pygsound-0.3-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac32b415d699e34143715518ab2343e7470c2786e6d9e1435ca05d3fd24cc16 |
|
MD5 | c464efee1def07be58cee9e01c3eacb0 |
|
BLAKE2b-256 | 5b7927754d69e96249bddcce9085dced427478fca9b5db2123fc0a99d4894ca8 |
Hashes for pygsound-0.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf7e25d09976f91a0ca570dfa3376506537bc5096c10533b5966242a7fc6cfc |
|
MD5 | fb73e86d23fc9b703d49f84070634d1f |
|
BLAKE2b-256 | af446fcf7f2827b9e8f97834aa2fa73df9b9744d4a311037a056294d04219280 |
Hashes for pygsound-0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9204e06ded752211bbca8862febf208d81e35a7aa98db240c21192587e52631c |
|
MD5 | 63e92fac9762576a0fcb2cb8e7563273 |
|
BLAKE2b-256 | 20218eac4aac1297abbad37226946329dcaab3036f528a41451540f4f5ab8c9f |
Hashes for pygsound-0.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c4f5ebb2deffa4ca337bbf6effae2eb3cf28780157d940ee34e81092536fde8 |
|
MD5 | 8f10018d82c7eaf15797b9617e2035a9 |
|
BLAKE2b-256 | 6a9399df614d88c92fea445add891845590cc7402de99351ee27874fc8cd13e8 |
Hashes for pygsound-0.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14f581941b78fc04bf7afb422c7d0f6511c83b7f84df63d0a0e329730a3d38f2 |
|
MD5 | d034dfbca3113a114e82a2e1467a1412 |
|
BLAKE2b-256 | ec8df26131498394ac23f031fd858d178e37febd62ea979672f9b2fef9fb5b29 |
Hashes for pygsound-0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16be5a98a16f04e80135d988c04c4342bc44c949ce7f0429ca5e8fe081d85833 |
|
MD5 | 9ecd8427d1cb1de8e5d6300dc64a6a31 |
|
BLAKE2b-256 | f6d3a6d6222b352208dfa9e4c30efd8afff28d1bb9612822d696e41a6a040b1a |
Hashes for pygsound-0.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4faa9ccb58a84fbb9823d702f8dad676bd20bf021d31b4df0e94959228b5857 |
|
MD5 | 03cbcd18c015d2515457ebe80112460c |
|
BLAKE2b-256 | 3b77dc2169ea7537abfae4164192541fe92a37735c30b9eda3b08ade845ecf46 |
Hashes for pygsound-0.3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30a3a5b3750988bb5c4e853a0e6181204e26757fa9afb964eb15d9c8d84c776d |
|
MD5 | 9f62063ff502348916c2a00a6c6a8a81 |
|
BLAKE2b-256 | adbde6efa3c43749424c260fc69103dc3236a3a63c41623d23ef024dfa3fce5d |
Hashes for pygsound-0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05e1607a87d8cbc9c08869fda1b8eb9703a1705fd90aabcd706c714168085e7e |
|
MD5 | c052b4f207fc1e2b28fb3287c2b1e629 |
|
BLAKE2b-256 | d05110de17fe9972d1d88f5beb3608d03eec8b44056b4f6d1361d3c6efecc72f |
Hashes for pygsound-0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af7d2c728485f10ccdf8fc246a928a3a5b8ca938fa087354c8c644c21443427b |
|
MD5 | c78622479b9ddc25c4b1bd2f290b4a6b |
|
BLAKE2b-256 | ce3d23fbfc3b6c10f10e59f74a12df21324d21a021c11cdfe4739155c4499c25 |
Hashes for pygsound-0.3-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa03d7303308ba42f2e31ac1faf1191e02cee221aa6adeb0f551a064aa589d3 |
|
MD5 | a59e9944d0238d5539f564fbb0495d07 |
|
BLAKE2b-256 | 305660c48aee460984fe9c7d14eb4dab2cf550fffb5cda197a33a5fd1cc051e5 |
Hashes for pygsound-0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50258550efdd929b03db8beeeff3b9eae00cc2a548bc316f4871749f1e3dd283 |
|
MD5 | 8c0c7e64a9d61c70e0a53373ac514140 |
|
BLAKE2b-256 | 4930a8aad4da61f53de8cc9940cf078578aa22474ff2fd3cb18b74de59dcc356 |
Hashes for pygsound-0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b97c84f831c4752f886e7b402a3e8afc09a789ff0cce2eb1adfc8b14aaac3197 |
|
MD5 | e4cedd88b86be1bb7d16512a758e6552 |
|
BLAKE2b-256 | 1c79d6f27ca389986054e153d88284485b668c982ccc304b3a49ad7353de63c2 |
Hashes for pygsound-0.3-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0a5dbd1c7ba0c64d53beb6f45a6efa1ee4aaec6aa6b6ebfe583bcba425a30d2 |
|
MD5 | bb833f46be7be36cb7d9c7628feb9e89 |
|
BLAKE2b-256 | 4ad6ccd9eef175015316970d45a46c7a21226cb0d2f7746aea54d069d5548e60 |
Hashes for pygsound-0.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdc79acfb31fe9beac814a759c2ed297a8ea73a3b45f8ebe4d003898a9462a8f |
|
MD5 | a3708ec5dc155956985bafa8c1f34047 |
|
BLAKE2b-256 | 8919d5f7a6aa13cd619add20a7fc5a66c778f70dea7ade266b46e55a27afda24 |
Hashes for pygsound-0.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed4ecbdce02d7ac5b891827448744e5ceefed4de46265103392aca2b97d80a37 |
|
MD5 | 201dd8d91de9039ad530eea022c47646 |
|
BLAKE2b-256 | 334968e6aff2088ecb0eaf96ad55f89b2962e9584362762963fbea254682c045 |