Play a RAW data file, stored on a Serial Flash chip. These chips are far more efficient than SD cards, allowing many files to be played simultaneously by copies of this object.
W25Q128FV Serial Flash
Port | Purpose |
---|---|
Out 0 | Sound Output |
play(filename);
Begin playing a RAW data file. If a file is already playing, it is stopped and this file starts playing from the beginning.
stop();
Stop playing. If not playing, this function has no effect.
isPlaying();
Return true (non-zero) if playing, or false (zero) when not playing.
positionMillis();
While playing, return the current time offset, in milliseconds. When not playing, the return from this function is undefined.
lengthMillis();
Return the total length of the current sound clip, in milliseconds. When not playing, the return from this function is undefined.
TODO: play example needed....
File > Examples > SerialFlash > CopyFromSD
The data file must be RAW 16 bit signed integers in LSB-first format.
The SerialFlash library is used to access the flash chip. You can also use SerialFlash's functions to access the stored files, or add data to the flash chip.
File names are case sensitive with SerialFlash. If your sound does not play, use File > Examples > SerialFlash > ListFiles to check the exact file names stored in the flash memory chip.