Browse Source

Rename AudioPlaySDcardWAV to AudioPlaySdWav

dds
PaulStoffregen 10 years ago
parent
commit
5ff60b9a70
3 changed files with 12 additions and 12 deletions
  1. +1
    -1
      examples/PlayWavFromSdCard/PlayWavFromSdCard.ino
  2. +9
    -9
      play_sd_wav.cpp
  3. +2
    -2
      play_sd_wav.h

+ 1
- 1
examples/PlayWavFromSdCard/PlayWavFromSdCard.ino View File

@@ -6,7 +6,7 @@
// Create the Audio components. These should be created in the
// order data flows, inputs/sources -> processing -> outputs
//
AudioPlaySDcardWAV wav;
AudioPlaySdWav wav;
AudioOutputI2S dac;

// Create Audio connections between the components

+ 9
- 9
play_sd_wav.cpp View File

@@ -40,7 +40,7 @@
#define STATE_PARSE4 11 // ignoring unknown chunk
#define STATE_STOP 12

void AudioPlaySDcardWAV::begin(void)
void AudioPlaySdWav::begin(void)
{
state = STATE_STOP;
state_play = STATE_STOP;
@@ -56,7 +56,7 @@ void AudioPlaySDcardWAV::begin(void)
}


bool AudioPlaySDcardWAV::play(const char *filename)
bool AudioPlaySdWav::play(const char *filename)
{
stop();
wavfile = SD.open(filename);
@@ -68,7 +68,7 @@ bool AudioPlaySDcardWAV::play(const char *filename)
return true;
}

void AudioPlaySDcardWAV::stop(void)
void AudioPlaySdWav::stop(void)
{
__disable_irq();
if (state != STATE_STOP) {
@@ -86,7 +86,7 @@ void AudioPlaySDcardWAV::stop(void)
}
}

bool AudioPlaySDcardWAV::start(void)
bool AudioPlaySdWav::start(void)
{
__disable_irq();
if (state == STATE_STOP) {
@@ -101,7 +101,7 @@ bool AudioPlaySDcardWAV::start(void)
}


void AudioPlaySDcardWAV::update(void)
void AudioPlaySdWav::update(void)
{
// only update if we're playing
if (state == STATE_STOP) return;
@@ -175,7 +175,7 @@ void AudioPlaySDcardWAV::update(void)
// https://ccrma.stanford.edu/courses/422/projects/WaveFormat/

// Consume already buffered data. Returns true if audio transmitted.
bool AudioPlaySDcardWAV::consume(void)
bool AudioPlaySdWav::consume(void)
{
uint32_t len, size;
uint8_t lsb, msb;
@@ -185,7 +185,7 @@ bool AudioPlaySDcardWAV::consume(void)
p = buffer + 512 - size;
start:
if (size == 0) return false;
//Serial.print("AudioPlaySDcardWAV write, size = ");
//Serial.print("AudioPlaySdWav write, size = ");
//Serial.print(size);
//Serial.print(", data_length = ");
//Serial.print(data_length);
@@ -386,7 +386,7 @@ start:

// this is not supposed to happen!
//default:
//Serial.println("AudioPlaySDcardWAV, unknown state");
//Serial.println("AudioPlaySdWav, unknown state");
}
state_play = STATE_STOP;
state = STATE_STOP;
@@ -419,7 +419,7 @@ start:



bool AudioPlaySDcardWAV::parse_format(void)
bool AudioPlaySdWav::parse_format(void)
{
uint8_t num = 0;
uint16_t format;

+ 2
- 2
play_sd_wav.h View File

@@ -30,10 +30,10 @@
#include "AudioStream.h"
#include "SD.h"

class AudioPlaySDcardWAV : public AudioStream
class AudioPlaySdWav : public AudioStream
{
public:
AudioPlaySDcardWAV(void) : AudioStream(0, NULL) { begin(); }
AudioPlaySdWav(void) : AudioStream(0, NULL) { begin(); }
void begin(void);

bool play(const char *filename);

Loading…
Cancel
Save