PhotonWaveOut: a lib to do software audio pcm playback

Hi,

I just published a small library to do pcm wave output on two digital pins. It uses SparkIntervalTimer (which you manually need to import into the project too since dependencies don’t work yet).
Also you need to convert a (short) sound file into a c-header and add it to the project.

Let me know what you think.

2 Likes

@ensonic, nice work! I posted an issue seeing that you are missing the demo music file in your repo (PhotonWaveOut.h). :wink:

Awesome idea, any chance of a demo video and wiring diagram? :smiley:

Nice! Could you explain the use of two digital pins in contrast to using the DAC on the photon?

I added a wiring diagram on github now. And there is also a sample wave_data.h included. Now I need to figure how to update my library on build.particle.io.

I’ve tried to play audio on the DAC pin, but only got silence:

After some hours I figured what the issues with the dac is, it is broken and I am not the first who discovered it.

Any chance someone can take a look?

1 Like

@mdma, that was the issue I tried to pull your attention to last week on slack :wink:

Hey, nice work! Just playing with the code :slight_smile:

Can this software handle playing more than one wav at the same time?

It does not mix. Please also understand that by now this is mostly educ ational. DMA and DAC now works just fine. By using the DAC you get 14bit.

Hi ensonic,
if I set the loop to false

wave->play(wave_data, sizeof(wave_data), false);

after playing the sample, my photon (firmware 0.5.1) blink red and reboot

Can you help me ?