Comments (15)
Hi, thanks for your interest in ambisonic!
It's not dead, yet... let's say it's sleeping instead.
I'm not currently using audio, that's why no new features are being added to this project at the moment.
However, I'm happy to provide support or update dependencies if there is demand. Pull requests are welcome too :)
from ambisonic.
Hi, thanks for the quick response! I might have something cooked up for a merge request! Hint: Speed of sound
from ambisonic.
Sounds interesting. Physical speed of sound, such as used for doppler effects or speed of playback?
from ambisonic.
from ambisonic.
This might come at a cost, though. In the general case a realistic simulation requires a variable-length buffer for each sound source. Maybe it's enough to avoid the buffer and simply delay the start of a sound. I don't know if that would be realistic enough.
What are your thoughts on how this could be implemented?
from ambisonic.
So my idea was, just like you'd suggested, to give each positional sound a starting time and then start a second thread, that on a certain interval calculates the distance's to every object with this flag enabled. It would also check for every object if the calculated time, for when it should start playing, is greater then the system time and then plays the sound.
from ambisonic.
I will probably commence work on this on Sunday. For now I will create a fork and a draft PR.
from ambisonic.
I just created the fork and created the draft PR: #18. You are welcome.
from ambisonic.
For the doppler effect there is a speed of sound parameter. It would be nice if that could be used to determine the scale too.
from ambisonic.
It probably shouldn't be used to determine the scale, rather the opposite. As far as I understand the code now just arbitrarily assumes 1v-unit=1m.
from ambisonic.
I'm pretty sure, that this assumption will be false in 90% of cases.
from ambisonic.
Actually, most of the code does not need to make any assumptions about scale. The only place where it does matter for now is computing the doppler rate.
For a distance-based delay works similarly - twice the scale or half the speed of sound is the same thing.
Now here is where the current simple assumption starts to break down:
Only the scale (but not the speed of sound) should matter for distance-based attenuation - but it doesn't (yet).
In order to make that physically correctish a separate scale parameter will be needed anyway.
Sorry for the rant. In short:
Right, please add a scale parameter. We'll just need to make sure it correctly interacts with the doppler effect.
from ambisonic.
Might I suggest, that (maybe as a separate PR) we switch to using cgmath or some other lightweight vector library since it removes a lot of repetition from the code(see distance calculation).
from ambisonic.
While hesitant to add further dependencies (rodio alone is a nightmare to maintain) I'm not strictly opposed. This should go into a separate issue, though.
from ambisonic.
Agreed
from ambisonic.
Related Issues (11)
- Playback bug when using z-coordinate HOT 1
- Demonstration Video HOT 6
- HRTF causes underrun in ALSA HOT 2
- Sounds on the right seem centered HOT 3
- Questions about positioning sounds HOT 3
- explain relationship to `rodio::source::Spatial` HOT 1
- Physically correct distance-attenuation
- Questions about loading an mp3/wav from rodio HOT 8
- Make the `play_at` API accept other sample types than f32. HOT 3
- How to restart stream after pause/stop? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ambisonic.