@@ -31,9 +31,11 @@ class AudioServer {
31
31
* @brief Construct a new Audio W A V Server object
32
32
* We assume that the WiFi is already connected
33
33
*/
34
- AudioServer () {
34
+ AudioServer (int port= 80 ) {
35
35
// the client returns 0 for avialableForWrite()
36
36
copier.setCheckAvailableForWrite (false );
37
+ WiFiServer tmp (port);
38
+ server = tmp;
37
39
}
38
40
39
41
@@ -43,11 +45,13 @@ class AudioServer {
43
45
* @param network
44
46
* @param password
45
47
*/
46
- AudioServer (const char * network, const char *password) {
48
+ AudioServer (const char * network, const char *password, int port= 80 ) {
47
49
this ->network = (char *)network;
48
50
this ->password = (char *)password;
49
51
// the client returns 0 for avialableForWrite()
50
52
copier.setCheckAvailableForWrite (false );
53
+ WiFiServer tmp (port);
54
+ server = tmp;
51
55
}
52
56
53
57
/* *
@@ -145,7 +149,7 @@ class AudioServer {
145
149
146
150
protected:
147
151
// WIFI
148
- WiFiServer server = WiFiServer( 80 ) ;
152
+ WiFiServer server;
149
153
WiFiClient client_obj;
150
154
char *password = nullptr ;
151
155
char *network = nullptr ;
@@ -246,7 +250,7 @@ class AudioEncoderServer : public AudioServer {
246
250
* @brief Construct a new Audio W A V Server object
247
251
* We assume that the WiFi is already connected
248
252
*/
249
- AudioEncoderServer (AudioEncoder *encoder) : AudioServer() {
253
+ AudioEncoderServer (AudioEncoder *encoder, int port= 80 ) : AudioServer(port ) {
250
254
this ->encoder = encoder;
251
255
}
252
256
@@ -256,7 +260,7 @@ class AudioEncoderServer : public AudioServer {
256
260
* @param network
257
261
* @param password
258
262
*/
259
- AudioEncoderServer (AudioEncoder *encoder, const char * network, const char *password) : AudioServer(network, password) {
263
+ AudioEncoderServer (AudioEncoder *encoder, const char * network, const char *password, int port= 80 ) : AudioServer(network, password, port ) {
260
264
this ->encoder = encoder;
261
265
}
262
266
@@ -363,7 +367,7 @@ class AudioWAVServer : public AudioEncoderServer {
363
367
* @brief Construct a new Audio W A V Server object
364
368
* We assume that the WiFi is already connected
365
369
*/
366
- AudioWAVServer () : AudioEncoderServer(new WAVEncoder()){
370
+ AudioWAVServer (int port= 80 ) : AudioEncoderServer(new WAVEncoder(), port ){
367
371
}
368
372
369
373
/* *
@@ -372,7 +376,7 @@ class AudioWAVServer : public AudioEncoderServer {
372
376
* @param network
373
377
* @param password
374
378
*/
375
- AudioWAVServer (const char * network, const char *password) : AudioEncoderServer(new WAVEncoder(), network, password) {
379
+ AudioWAVServer (const char * network, const char *password, int port= 80 ) : AudioEncoderServer(new WAVEncoder(), network, password, port ) {
376
380
}
377
381
378
382
// / Destructor: release the allocated encoder
0 commit comments