Adafruit WaveHC Arduino Library
Classes | Macros
WaveHC.h File Reference
#include "Arduino.h"
#include <FatReader.h>

Go to the source code of this file.

Classes

class  WaveHC
 Wave file player. More...
 

Macros

#define OPTIMIZE_CONTIGUOUS   1
 
#define DVOLUME   0
 
#define RATE_ERROR_LEVEL   2
 
#define PLAYBUFFLEN   512UL
 
#define MAX_BYTE_RATE   88200
 
#define MAX_CLOCK_RATE   44100
 

Detailed Description

This library is a highly modified version of Ladyada's Wave Shield library. I have made many changes that may have introduced bugs.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

BSD license, all text here must be included in any redistribution.

WaveHC class

Macro Definition Documentation

◆ OPTIMIZE_CONTIGUOUS

#define OPTIMIZE_CONTIGUOUS   1

If nonzero, optimize the player for contiguous files. It takes longer to open a file but can play contiguous files at higher rates. Disable if you need minimum latency for open. Also see open by index.

◆ DVOLUME

#define DVOLUME   0

Software volume control should be compatible with Ladyada's library. Uses shift to decrease volume by 6 dB per step. See DAC ISR in WaveHC.cpp. Must be set after call to WaveHC::create(). Decreases MAX_CLOCK_RATE to 22050.

◆ RATE_ERROR_LEVEL

#define RATE_ERROR_LEVEL   2

Set behavior for files that exceed MAX_CLOCK_RATE or MAX_BYTE_RATE. If RATE_ERROR_LEVEL = 2, rate too high errors are fatal. If RATE_ERROR_LEVEL = 1, rate too high errors are warnings. If RATE_ERROR_LEVEL = 0, rate too high errors are ignored.

◆ PLAYBUFFLEN

#define PLAYBUFFLEN   512UL

Buffer length for Arduinos other than 168.

◆ MAX_BYTE_RATE

#define MAX_BYTE_RATE   88200

Maximum SD read rate for 512 byte buffer and contiguous file

◆ MAX_CLOCK_RATE

#define MAX_CLOCK_RATE   44100

maximum DAC clock rate