diff --git a/examples/examples-audiokit/streams-audiokit-webserver_mp3/streams-audiokit-webserver_mp3.ino b/examples/examples-audiokit/streams-audiokit-webserver_mp3/streams-audiokit-webserver_mp3.ino index 4e9c4856ee..c4fc55933d 100644 --- a/examples/examples-audiokit/streams-audiokit-webserver_mp3/streams-audiokit-webserver_mp3.ino +++ b/examples/examples-audiokit/streams-audiokit-webserver_mp3/streams-audiokit-webserver_mp3.ino @@ -11,7 +11,7 @@ #include "AudioCodecs/CodecMP3LAME.h" #include "AudioLibs/AudioKit.h" -AudioEncoderServer server(new MP3EncoderLAME(),"Phil Schatzmann","sabrina01"); +AudioEncoderServer server(new MP3EncoderLAME(),"SSID","password"); AudioKitStream i2sStream; // Access I2S as stream void setup(){ diff --git a/examples/examples-webserver/streams-generator-webserverex_wav/streams-generator-webserverex_wav.ino b/examples/examples-webserver/streams-generator-webserverex_wav/streams-generator-webserverex_wav.ino index 0e98e31e0d..508d11c67d 100644 --- a/examples/examples-webserver/streams-generator-webserverex_wav/streams-generator-webserverex_wav.ino +++ b/examples/examples-webserver/streams-generator-webserverex_wav/streams-generator-webserverex_wav.ino @@ -12,8 +12,8 @@ #include "AudioLibs/AudioServerEx.h" // WIFI -const char *ssid = "Phil Schatzmann"; -const char *password = "sabrina01"; +const char *ssid = "SSID"; +const char *password = "password"; const int sample_rate = 10000; const int channels = 1; @@ -44,5 +44,6 @@ void setup() { // copy the data void loop() { - copier.copy(); + copier.copy(); // copy data to server + server.copy(); // from server to client } diff --git a/examples/examples-webserver/streams-generator-webserverex_wav1/streams-generator-webserverex_wav1.ino b/examples/examples-webserver/streams-generator-webserverex_wav1/streams-generator-webserverex_wav1.ino index f28f28c0f1..d0c1d471df 100644 --- a/examples/examples-webserver/streams-generator-webserverex_wav1/streams-generator-webserverex_wav1.ino +++ b/examples/examples-webserver/streams-generator-webserverex_wav1/streams-generator-webserverex_wav1.ino @@ -12,8 +12,8 @@ #include "AudioLibs/AudioServerEx.h" // WIFI -const char *ssid = "Phil Schatzmann"; -const char *password = "sabrina01"; +const char *ssid = "SSID"; +const char *password = "password"; const int sample_rate = 10000; const int channels = 1; diff --git a/library.properties b/library.properties index 0a39f60808..b70a424d31 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=audio-tools -version=0.8.0 +version=0.9.1 author=Phil Schatzmann maintainer=Phil Schatzmann sentence=Some useful audio processing classes diff --git a/src/AudioTools/AudioCopy.h b/src/AudioTools/AudioCopy.h index 5676279939..49768f598e 100644 --- a/src/AudioTools/AudioCopy.h +++ b/src/AudioTools/AudioCopy.h @@ -91,13 +91,20 @@ class StreamCopyT { LOGD(LOG_METHOD); // if not initialized we do nothing if (from==nullptr || to==nullptr) return 0; - + + // If we try to write to a server we might not have any output destination yet + int to_write = to->availableForWrite(); + if (to_write<=0){ + delay(500); + return 0; + } + + size_t result = 0; size_t delayCount = 0; size_t len = available(); size_t bytes_to_read = buffer_size; size_t bytes_read = 0; - int to_write = to->availableForWrite(); if (len>0){ bytes_to_read = min(len, static_cast(buffer_size));