Giter Club home page Giter Club logo

pico-pwm-audio's People

Contributors

mrsmoer avatar rgrosset avatar robin7g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pico-pwm-audio's Issues

Wrap vs. levels in sample data

Thanks a lot for sharing this project!

You set the PWM wrap to 250 but amplitude levels in e.g. sample.h go up to 256, doesn't that mean that you slightly amplify the sound (by 256/250) and then clip the loudest parts of the waveform?

See this chart for the specs:

image

IIUC
wrap = top counter level = 250
level = end of duty cycle

so, that for all values >= 250 you get a full duty cycle / voltage.

Using the converter

Hello Robin,

Could you add a few instructions on how to use the converter please?

Thanks

Won't compile sample larger then 15 seconds at 11 mhz

I'm trying to compile with a sample.h file that is larger then 15 seconds at 11 mhz.
I keep getting this message when trying to compile the file for my pi pico.
I don't know cmake, or make very well. I have compile c/c++ but it's been a long time.

I get a message stating that there is not enough space in RAM but don't know where I would go to increase the reserved ram so I can just get the program compiled. I tried to increase the RAM section in the pico-pwm-audio.map file but it doesn't seem to make a difference.

Maybe I need to run cmake again after I adjust the map file? I'm not sure and just home I can get more then 15 seconds of audio to play. If this is the max amount of time, that is all I need to know.

Let me know if you need more information regarding my issue.

Thank you in advance for any assistance.

Any chance you could upload the pico-pwm-audio.uf2

... so I can check my circuit works, before battling with getting the compiler working. I usually use the Arduino IDE, so I don't have the Raspberry Pi Pico SDK installed. If it works, I could try and port it to the Arduino IDE. Thanks.

Playing 16 bit audio using this sample

Hi could you please let me know how you chose the value 250 for this function in pico-pwm-audio.c
pwm_config_set_wrap(&config, 250);
I can understand how your clock divider and other values ultimately set a sampling frequency of 11000 Hz for the clock frequency you have chosen, but I wanted to understand how you chose those specific values.

The reason I ask this is because I want to take audio input from a "line-out" audio signal attached to the ADC and play it back in PWM in real time. I don't have experience with generating audio using PWM and your code is also serving as a tutorial for me. The ADC audio samples are 12-bits and I am storing them in a uint16 and the ADC values that I am getting are in the range 2030 to 2090. Since they are all bigger than 250, using your code as it is now and just using my ADC data as input for the PWM output does not generate any PWM signal. I have tried changing the 12-bits of ADC to 8 [doing something like this in pwm_interrupt_handler()]
pwm_set_gpio_level(AUDIO_PIN, (WAV_DATA[wav_position>>3]) >>4);
but that also adds a lot of noise to the output sound, so I think I may be going about this the wrong way.

So I am guessing it is better if I do not loose any bits of my audio samples and find out a way of playing them as 16 bit audio. Could you give me some ideas on how to do this, or at least what is the proper way to choose the pwm_config_set_wrap value, and the number of shifts in WAV_DATA[wav_position>>3]?

CMakeLists.txt has hardcoded location

Hi, thanks for your example file for the PWM audio and supporting files. this has been a great help so far

1 minor snafu: your CMakeLists.txt file has your SDK location hardcoded, preventing cmake from running for everyone without a user called robin ;) . A quick '#' solved the issue

It was a quick and easy fix for myself, but might catch some newer users trying to build the software

Finally, you propose the clone git@github link for downloading the repository. I would recommend changing that to the https://github version as otherwise the clone command will fail for users without an account on most clean build environments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.