Wav Audio Player
Rayman
Posts: 14,646
After figuring out some smartpin stuff, was pretty easy to convert wav player to P2.
This example is set for A/V accessory board on P8 and the wav file copied to uSD card on eval board.
As before, .wav files have to be 16-bit PCM encoded
Uses @cheezus FSRW with inline assembly SPI driver. (Note: This part needs some work, you may or may not have to remove card momentarily between uses).
The binary is there or you can compile with FastSpin Version 4.1.4
Use a serial terminal at 115200 baud to see diagnostic info...
This example is set for A/V accessory board on P8 and the wav file copied to uSD card on eval board.
As before, .wav files have to be 16-bit PCM encoded
Uses @cheezus FSRW with inline assembly SPI driver. (Note: This part needs some work, you may or may not have to remove card momentarily between uses).
The binary is there or you can compile with FastSpin Version 4.1.4
Use a serial terminal at 115200 baud to see diagnostic info...
Comments
Was a bit of a trick because only had one cog left and you really need two: One to full the buffers from SD and one to output to pins.
Figured out a way to add the buffer filling job into the main idle process and it works OK with big buffers.
But, I see a flaw and also one less than idea thing right away.
The flaw is that the volume scales the output from 0V and not from 3.3/2 V. This limits the usefulness of my gain knob as it goes off scale when gain raised too much...
The less than ideal thing is the stair stepped nature of the output. Would probably be better to do smooth transitions...
Got something unexpected when I changed analog channels to the actual audio output pins.
Trying to figure what this is....
If I right shift the analog data 6 places, I get something that might be the analog output (but small in amplitude).
Must be what I'm seeing...
Andy
Here’s a video of wav playing on scope
Now you need to add a microphone input, and display of mic signal, for the full P2 karaoke experience
I'm looking at input on pins 8 & 9 that is jumpered in from pins 14&15. So, there should be no loading.
Have to go to 10X mode to get it to be close to full range on display.
So, I guess output is only around 0.33 volts in amplitude...
Andy