Still some minor issues, I think I am missing something about the PCM coding (mayber theres cutoff or something) and I still have not got the I2C digital potentiometer (volume control) fully figured out (as evidence when I turn it to silent and theres a crackle)
Ok everyone, release of new sound routines and SD card lib is very close.
Small improvements to code have yielded quite substantial improvements in SD card sound output, both on internal speaker and headphone connection. I was able to get 44.1kHz (CD quality) but visualizer slowed down too much.
I think this is a pretty convincing proof-of-concept, considering its a 16-bit wav processed real time.
Does that mean we could now use the Pokkito as a portable music player? hehe
I wonder how long the battery would go with the screen off and playing music to headset. Also ask if MP3 could be supported too, but that might be too CPU intensive I guess?
Ofcourse I could do it (mp3 player) but I need to get this library revision out and focus on other things.
We have one big advantage in the Pokitto hardware: the sd card. I was thinking of doing a real FFT (fourier transformation) visualizer by preprocessing the sound file to the SD card before playback. The same strategy could be used to decode the mp3.
I hope someone takes up the challenge to make an user interface to the wav player once I push this code to the github repo.
That’s good to know. It might well outdo my actual mp3 player.
(By some miracle some of us still have mp3 players.)
It shouldn’t do.
It might not be possible to do it ‘on the fly’ (it might have to be converted to a .wav beforehand, even if the result is kept in RAM), but it should be possible to do in software.
So it’ll probably need a library.
If there isn’t an mbed one for it, it should be possible to port a general C++ library to do it.
Unfortunately this is one thing I can’t volunteer to contribute to - sound programming is one thing I’m still terrible at. I don’t even understand fourier transforms (yet).
(Plus I’m still working on other projects.)
Yeah, sound coding is pretty well outside my wheelhouse as well.
@jonne, how is the performance with the sound? I noticed that the previous sound library version slowed performance down pretty substantially (approximately 20-40%) just by being turned on without anything playing.
Perhaps when it comes to the ‘hatting’ stage there ought to be an APU (Audio Processing Unit) hat for games that want a sound boost?
(e.g. A small board with a cheap chip and some software for number crunching audio signals.)