arpruss / USBComposite_stm32f1

USB Composite library for STM32F1 (HID, Serial, MIDI and XBox360 controller)
Other
382 stars 76 forks source link

audio: Improve tonegenerator examples #45

Closed soreau closed 4 years ago

soreau commented 4 years ago

This fixes some glitches in the generated wave, mostly by lowering the sample rate from 24000 to 8000. It also adds a function to get the radians increment for the wave from hz, which bases off the rate. This means it attempts to make the frequency consistent between different sample rates but it does poorly on rates higher than 8000.