PWMAudio use #2723
Replies: 5 comments 4 replies
-
You can read data from wherever you like to send to PWMAudio, just look at the SD examples and work from there. To change pitch you can, within reason, just change the PWM frequency. Higher frequency = higher pitch. --edit-- Actually, just remembered that changing to non-standard frequencies takes a long time because the Pico has to try and calculate the best new set of dividers which it does using brute-force. Instead, just drop or duplicate every X samples to drop or raise pitch. To change volume you need to scale the samples up or down (i.e. multiply by >1 or <1). I would recommend using fixed point math instead of |
Beta Was this translation helpful? Give feedback.
-
NotSoSimpleMP3Shuffle.zip |
Beta Was this translation helpful? Give feedback.
-
I don't understand why i haven't sound on my pin 1 :-( |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer, but i am not enough good coder for write what you say me. |
Beta Was this translation helpful? Give feedback.
-
Hello, I use a RP2040 Waveshare RP2040 Zero and i love you PWMAudio library.
I play with and i can use the demo with success.
I try to build a RC motor simulator.
For that , i want to play two differents sounds, one for the start and another as loop.
I should like to know if it's possible to change the volume, the pitch and the speed of the sample.
Actually, we need to compile a file.h but i should like to select a wav file from a SD card.
Is it possible to add these options ?
I send you my actual code.
Thanks for your fantastic work,
Engine_Audio.zip
Pierre
Beta Was this translation helpful? Give feedback.
All reactions