mirror of
https://github.com/pschatzmann/arduino-audio-tools.git
synced 2024-09-21 10:27:27 +00:00
webserver example correction
This commit is contained in:
parent
80659b8409
commit
39c2cb6332
@ -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(){
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=audio-tools
|
||||
version=0.8.0
|
||||
version=0.9.1
|
||||
author=Phil Schatzmann
|
||||
maintainer=Phil Schatzmann <phil.schatzmann@gmail.com>
|
||||
sentence=Some useful audio processing classes
|
||||
|
@ -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<size_t>(buffer_size));
|
||||
|
Loading…
Reference in New Issue
Block a user