Comments (3)
How large were the fluctuations in frequency? Around 30-40hz? If they were small fluctuations, they might be because of the phase's resolution (32-bit floating point) changing to a f64 might fix this?
As for the signed/unsigned, I'm not sure (don't have time to check atm).
from cpal.
I don’t know how big the fluctuations are in Hz, but it is all pretty much in the range of one note difference. Thinking about it again, I now know exactly what the problem is: it is indeed a floating-point problem. You get rounding errors, because the accumulator grows very rapidly, so 0.03
becomes small in comparison with the accumulator quickly, and precision is lost when adding. The proper way to deal with this is to use compensated summation, but in this case there is an easier solution, which I happened to implement accidentally: use multiplication by a counter instead of addition. So I opened #40 because I thought this was neater than the manual Iterator
implementation, and it happens to fix this fluctuation as well!
from cpal.
This has been fixed in #51.
from cpal.
Related Issues (20)
- Record system audio on multiple platforms
- Suppport ScreenCaptureKit loopback HOT 5
- ```cpal::default_host().default_input_device()``` doesn't work in WASM environment
- [QUESTION] Cpal + wasm + WebAudioAPI setup
- [Question/Feature] Get channel names of a device for certain platforms
- `NoDevice` error on web
- Audio sampling data problem HOT 2
- ASIO4ALL.org looks... unsafe. HOT 3
- Using Asio4All results in StreamConfigNotSupported
- Adding visionOS support
- Min buffer size range detected on Android is huge (~1sec) HOT 1
- Extremely distorted audio on Windows with Razer 7.1 Surround Sound
- record_wav example, question about using Option HOT 1
- example on how to record output device to wav HOT 2
- cannot use my audio input / output after using cpal (need to reboot computer)
- Android `failed to load dynamic library: dlopen failed: library "libc++shared.so" not found` HOT 5
- macOS asks for permission to use the microphone when accessing the default output device HOT 1
- Android won't adhere to fixed buffer size
- how can we financially support the maintenance of cpal?
- How to use multiple output devices in macOS?
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 cpal.