sound_generator icon indicating copy to clipboard operation
sound_generator copied to clipboard

How often can the frequency be updated per second?

Open gordogato81 opened this issue 2 years ago • 1 comments

I have been experimenting with using the sound generator to tonally represent G-forces using the userAccelerometer from the motion_sensors package. Through these experiments, I have noticed that the sound generator does not update the frequency of the wave more than about 5 times a second (5hz).

Is it possible to increase this update rate? Ideally, I would like an update rate of about 30hz.

I apologize if this is the wrong place for this question. If so, please point me to the right place.

gordogato81 avatar Oct 22 '22 20:10 gordogato81

Take a look at the AudioTrack.Builder. I changed the SoundGenerator a little bit and now have an instantly changing sound generator: https://github.com/si-gr/sound_generator/commit/beab4ec9b972ba18da14cde82d952a6a864db2f5

si-gr avatar Feb 26 '23 14:02 si-gr