Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dd4f24056 | ||
|
|
627a106479 | ||
|
|
6882b6e1b6 | ||
|
|
6ed2604015 | ||
|
|
5a5c2a88a3 | ||
|
|
c3c9a147c5 |
No files matched your search
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/earlephilhower/ESP8266Audio"
|
"url": "https://github.com/earlephilhower/ESP8266Audio"
|
||||||
},
|
},
|
||||||
"version": "1.9.1",
|
"version": "1.9.3",
|
||||||
"homepage": "https://github.com/earlephilhower/ESP8266Audio",
|
"homepage": "https://github.com/earlephilhower/ESP8266Audio",
|
||||||
"frameworks": "Arduino",
|
"frameworks": "Arduino",
|
||||||
"examples": [
|
"examples": [
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name=ESP8266Audio
|
name=ESP8266Audio
|
||||||
version=1.9.1
|
version=1.9.3
|
||||||
author=Earle F. Philhower, III
|
author=Earle F. Philhower, III
|
||||||
maintainer=Earle F. Philhower, III
|
maintainer=Earle F. Philhower, III
|
||||||
sentence=Audio file and I2S sound playing routines for ESP8266, ESP32, and Raspberry Pi Pico RP2040
|
sentence=Audio file and I2S sound playing routines for ESP8266, ESP32, and Raspberry Pi Pico RP2040
|
||||||
|
|||||||
@@ -21,9 +21,7 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
#include "driver/i2s.h"
|
#include "driver/i2s.h"
|
||||||
#elif defined(ESP8266)
|
#elif defined(ARDUINO_ARCH_RP2040) || defined(ESP8266)
|
||||||
#include <i2s.h>
|
|
||||||
#elif defined(ARDUINO_ARCH_RP2040)
|
|
||||||
#include <I2S.h>
|
#include <I2S.h>
|
||||||
#endif
|
#endif
|
||||||
#include "AudioOutputI2S.h"
|
#include "AudioOutputI2S.h"
|
||||||
@@ -271,7 +269,12 @@ bool AudioOutputI2S::ConsumeSample(int16_t sample[2])
|
|||||||
{
|
{
|
||||||
s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
||||||
}
|
}
|
||||||
return i2s_write_bytes((i2s_port_t)portNo, (const char *)&s32, sizeof(uint32_t), 0);
|
//"i2s_write_bytes" has been removed in the ESP32 Arduino 2.0.0, use "i2s_write" instead.
|
||||||
|
// return i2s_write_bytes((i2s_port_t)portNo, (const char *)&s32, sizeof(uint32_t), 0);
|
||||||
|
|
||||||
|
size_t i2s_bytes_written;
|
||||||
|
i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &i2s_bytes_written, 0);
|
||||||
|
return i2s_bytes_written;
|
||||||
#elif defined(ESP8266)
|
#elif defined(ESP8266)
|
||||||
uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
||||||
return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
|
return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
|
||||||
|
|||||||
@@ -21,9 +21,7 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
#include "driver/i2s.h"
|
#include "driver/i2s.h"
|
||||||
#elif defined(ESP8266)
|
#elif defined(ARDUINO_ARCH_RP2040) || defined(ESP8266)
|
||||||
#include <i2s.h>
|
|
||||||
#elif defined(ARDUINO_ARCH_RP2040)
|
|
||||||
#include <I2S.h>
|
#include <I2S.h>
|
||||||
#endif
|
#endif
|
||||||
#include "AudioOutputI2SNoDAC.h"
|
#include "AudioOutputI2SNoDAC.h"
|
||||||
@@ -97,8 +95,14 @@ bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2])
|
|||||||
|
|
||||||
// Either send complete pulse stream or nothing
|
// Either send complete pulse stream or nothing
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
|
//"i2s_write_bytes" has been removed in the ESP32 Arduino 2.0.0, use "i2s_write" instead.
|
||||||
|
// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
|
||||||
|
|
||||||
|
size_t i2s_bytes_written;
|
||||||
|
i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &i2s_bytes_written, 0);
|
||||||
|
if (!i2s_bytes_written){
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
#elif defined(ESP8266)
|
#elif defined(ESP8266)
|
||||||
if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
|
if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
|
||||||
// At this point we've sent in first of possibly 8 32-bits, need to send
|
// At this point we've sent in first of possibly 8 32-bits, need to send
|
||||||
|
|||||||
Reference in new issue
Block a user