Browse Source

minor fixes

main
Hendrik Langer 8 years ago
parent
commit
f5b952ccca
  1. 2
      src/main.cpp
  2. 2
      src/sound.cpp

2
src/main.cpp

@ -25,7 +25,7 @@ static const char *soundFile[3][3] = {{"/T0.wav", "/T1.wav", "/T2.wav"},
{"/T6.wav", "/T7.wav", "/T8.wav"}};
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 100; // the debounce time
unsigned long debounceDelay = 250; // the debounce time
void setup()
{

2
src/sound.cpp

@ -136,7 +136,7 @@ void Sound::play_task(void *pvParameter) {
while (buf_pos < BUF_LENGTH) {
// Serial.print("i2s_push free stack: "); Serial.println(uxTaskGetStackHighWaterMark( NULL ), DEC); // DEBUG
uint16_t *buf16 = (uint16_t *) buf;
int buf16_pos = buf_pos/4; // ToDo: why not 2?
int buf16_pos = buf_pos/(sizeof(uint16_t)*2); // ToDo: read number of channels samplerate etc
// convert data
//unsigned int sample = ((unsigned short) DataSource::buffer[DataSource::buf_pos] << 16 & 0xffff0000) | ((unsigned short) DataSource::buffer[DataSource::buf_pos]);
unsigned int sample = ((unsigned short) buf16[buf16_pos] << 16 & 0xffff0000) | ((unsigned short) buf16[buf16_pos]);

Loading…
Cancel
Save