File tree Expand file tree Collapse file tree 6 files changed +18
-16
lines changed
examples/sandbox/communication
communication-espnow-receive
communication-espnow-send
communication-serial-send Expand file tree Collapse file tree 6 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 15
15
16
16
uint16_t sample_rate = 44100 ;
17
17
uint8_t channels = 2 ; // The stream will have 2 channels
18
- SineWaveGenerator<sound_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
19
- GeneratedSoundStream<sound_t > sound ( sineWave); // Stream generated from sine wave
18
+ SineWaveGenerator<int16_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
19
+ GeneratedSoundStream<int16_t > sound ( sineWave); // Stream generated from sine wave
20
20
BluetoothSerial SerialBT;
21
21
StreamCopy copier (SerialBT, sound); // copies sound into i2s
22
22
Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ uint8_t channels = 2; // The stream will have 2 channels
18
18
ESPNowStream now;
19
19
I2SStream out;
20
20
StreamCopy copier (out, now);
21
- const char *ssd = " ssid" ;
21
+ const char *ssid = " ssid" ;
22
22
const char *password = " password" ;
23
- const char *peers[] = {" A8:48:FA:0B:93:40" }
23
+ const char *peers[] = {" A8:48:FA:0B:93:40" };
24
24
25
25
void setup () {
26
26
Serial.begin (115200 );
27
27
AudioLogger::instance ().begin (Serial, AudioLogger::Info);
28
28
29
29
now.addPeers (peers);
30
- now.begin (ssid, pasword );
30
+ now.begin (ssid, password );
31
31
32
32
// start I2S
33
33
Serial.println (" starting I2S..." );
Original file line number Diff line number Diff line change 15
15
16
16
uint16_t sample_rate = 44100 ;
17
17
uint8_t channels = 2 ; // The stream will have 2 channels
18
- SineWaveGenerator<sound_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
19
- GeneratedSoundStream<sound_t > sound ( sineWave); // Stream generated from sine wave
18
+ SineWaveGenerator<int16_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
19
+ GeneratedSoundStream<int16_t > sound ( sineWave); // Stream generated from sine wave
20
20
ESPNowStream now;
21
21
StreamCopy copier (now, sound); // copies sound into i2s
22
- const char *ssd = " ssid" ;
22
+ const char *ssid = " ssid" ;
23
23
const char *password = " password" ;
24
- const char *peers[] = {" A8:48:FA:0B:93:40" }
24
+ const char *peers[] = {" A8:48:FA:0B:93:40" };
25
25
26
26
void setup () {
27
27
Serial.begin (115200 );
28
28
AudioLogger::instance ().begin (Serial, AudioLogger::Info);
29
29
30
30
now.addPeers (peers);
31
- now.begin (ssid, pasword );
31
+ now.begin (ssid, password );
32
32
33
33
// Setup sine wave
34
34
sineWave.begin (channels, sample_rate, N_B4);
Original file line number Diff line number Diff line change 15
15
16
16
uint16_t sample_rate = 44100 ;
17
17
uint8_t channels = 2 ; // The stream will have 2 channels
18
- SineWaveGenerator<sound_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
19
- GeneratedSoundStream<sound_t > sound ( sineWave); // Stream generated from sine wave
18
+ SineWaveGenerator<int16_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
19
+ GeneratedSoundStream<int16_t > sound ( sineWave); // Stream generated from sine wave
20
20
WiFiClient client;
21
21
StreamCopy copier (client, sound); // copies sound into i2s
22
22
const char *ssid = " ssid" ;
23
+ const char *password = " password" ;
24
+
23
25
24
26
void setup () {
25
27
Serial.begin (115200 );
Original file line number Diff line number Diff line change 17
17
18
18
uint16_t sample_rate = 44100 ;
19
19
uint8_t channels = 2 ; // The stream will have 2 channels
20
- SineWaveGenerator<sound_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
21
- GeneratedSoundStream<sound_t > sound ( sineWave); // Stream generated from sine wave
20
+ SineWaveGenerator<int16_t > sineWave ( 32000 ); // subclass of SoundGenerator with max amplitude of 32000
21
+ GeneratedSoundStream<int16_t > sound ( sineWave); // Stream generated from sine wave
22
22
StreamCopy copier (Serial2, sound); // copies sound into i2s
23
23
24
24
void setup () {
Original file line number Diff line number Diff line change @@ -150,10 +150,10 @@ class ESPNowStream : public AudioStreamX {
150
150
// we use the first confirming mac_addr for further confirmations and ignore
151
151
// others
152
152
if (first_mac[0 ] == 0 ) {
153
- strcpy (first_mac, mac_addr);
153
+ strcpy (( char *) first_mac,( char *) mac_addr);
154
154
}
155
155
LOGI (" %s:%d" , mac_addr, status);
156
- if (strcmp (first_mac, mac_addr) == 0 && status == ESP_NOW_SEND_SUCCESS) {
156
+ if (strcmp (( char *) first_mac, ( char *) mac_addr) == 0 && status == ESP_NOW_SEND_SUCCESS) {
157
157
ESPNowStreamSelf->available_to_write = ESP_NOW_MAX_DATA_LEN;
158
158
}
159
159
}
You can’t perform that action at this time.
0 commit comments