|
@ -136,7 +136,7 @@ void Sound::play_task(void *pvParameter) { |
|
|
while (buf_pos < BUF_LENGTH) { |
|
|
while (buf_pos < BUF_LENGTH) { |
|
|
// Serial.print("i2s_push free stack: "); Serial.println(uxTaskGetStackHighWaterMark( NULL ), DEC); // DEBUG
|
|
|
// Serial.print("i2s_push free stack: "); Serial.println(uxTaskGetStackHighWaterMark( NULL ), DEC); // DEBUG
|
|
|
uint16_t *buf16 = (uint16_t *) buf; |
|
|
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
|
|
|
// 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) 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]); |
|
|
unsigned int sample = ((unsigned short) buf16[buf16_pos] << 16 & 0xffff0000) | ((unsigned short) buf16[buf16_pos]); |
|
|