Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Makefile
README
kernel.cpp
kernel.h
main.cpp
sound.h.gz

README

README 

This sample program uses the PWM device and the platform DMA controller to playback a short sound sample. You can listen to it via the 3.5mm headphone jack.

The provided (compressed) sound sample in sound.h.gz is recorded with 44100 Hz sample rate and 8 bit Mono (to keep it small). You can provide 16 bit Stereo sound on your own (e.g. by exporting it as 16 bit signed raw data without header from Audacity and converting it into ASCII with a little program). The sound.h file has to look like that in this case:

#define SOUND_CHANNELS		2
#define SOUND_BITS		16

signed short Sound[] =
{
1,0,-2,0,2,0,-2,0,2,1,-1,-1,0,1,0,-2,0,3,0,-3,1,3,-2,-2,
...
};

The PWM device always plays 44100 Hz 12 bit Stereo sound in Circle but other 8/16 bit Mono/Stereo formats will be converted while playing back.
You can’t perform that action at this time.