arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::AudioEncoderServer Class Reference

A simple Arduino Webserver which streams the audio using the indicated encoder.. This class is based on the WiFiServer class. All you need to do is to provide the data with a callback method or from a Stream. More...

#include <AudioServer.h>

Inheritance diagram for audio_tools::AudioEncoderServer:
audio_tools::AudioServer audio_tools::AudioWAVServer

Public Member Functions

 AudioEncoderServer (AudioEncoder *encoder, const char *network, const char *password, int port=80)
 Construct a new Audio W A V Server object. More...
 
 AudioEncoderServer (AudioEncoder *encoder, int port=80)
 Construct a new Audio W A V Server object We assume that the WiFi is already connected.
 
 ~AudioEncoderServer ()
 Destructor release the memory.
 
AudioEncoderaudioEncoder ()
 
void begin (AudioServerDataCallback cb, int sample_rate, int channels, int bits_per_sample=16)
 Start the server. The data must be provided by a callback method. More...
 
void begin (Stream &in, AudioBaseInfo info, BaseConverter< int16_t > *converter=nullptr)
 Start the server. You need to be connected to WiFI before calling this method. More...
 
void begin (Stream &in, int sample_rate, int channels, int bits_per_sample=16, BaseConverter< int16_t > *converter=nullptr)
 Start the server. You need to be connected to WiFI before calling this method. More...
 
- Public Member Functions inherited from audio_tools::AudioServer
 AudioServer (const char *network, const char *password, int port=80)
 Construct a new Audio W A V Server object. More...
 
 AudioServer (int port=80)
 Construct a new Audio W A V Server object We assume that the WiFi is already connected.
 
void begin (AudioServerDataCallback cb, const char *contentType)
 Start the server. The data must be provided by a callback method. More...
 
void begin (Stream &in, const char *contentType)
 Start the server. You need to be connected to WiFI before calling this method. More...
 
bool copy ()
 Add this method to your loop Returns true while the client is connected. (The same functionality like doLoop()) More...
 
bool doLoop ()
 Add this method to your loop Returns true while the client is connected.
 
Streamout ()
 
Streamout_ptr ()
 
void setConverter (BaseConverter< int16_t > *c)
 

Protected Member Functions

virtual void sendReplyContent ()
 
- Protected Member Functions inherited from audio_tools::AudioServer
void connectWiFi ()
 
void processClient ()
 
virtual void sendReplyContent ()
 
virtual void sendReplyHeader ()
 
void setupServer (int port)
 

Protected Attributes

AudioBaseInfo audio_info
 
EncodedAudioStream encoded_stream
 
AudioEncoderencoder = nullptr
 
- Protected Attributes inherited from audio_tools::AudioServer
AudioServerDataCallback callback = nullptr
 
WiFiClient client_obj
 
const char * content_type =nullptr
 
BaseConverter< int16_t > * converter_ptr = nullptr
 
StreamCopy copier
 
Streamin = nullptr
 
char * network = nullptr
 
char * password = nullptr
 
WiFiServer server
 

Detailed Description

A simple Arduino Webserver which streams the audio using the indicated encoder.. This class is based on the WiFiServer class. All you need to do is to provide the data with a callback method or from a Stream.

in -copy> client

Constructor & Destructor Documentation

◆ AudioEncoderServer()

audio_tools::AudioEncoderServer::AudioEncoderServer ( AudioEncoder encoder,
const char *  network,
const char *  password,
int  port = 80 
)
inline

Construct a new Audio W A V Server object.

Parameters
network
password

Member Function Documentation

◆ begin() [1/3]

void audio_tools::AudioEncoderServer::begin ( AudioServerDataCallback  cb,
int  sample_rate,
int  channels,
int  bits_per_sample = 16 
)
inline

Start the server. The data must be provided by a callback method.

Parameters
cb
sample_rate
channels

◆ begin() [2/3]

void audio_tools::AudioEncoderServer::begin ( Stream in,
AudioBaseInfo  info,
BaseConverter< int16_t > *  converter = nullptr 
)
inline

Start the server. You need to be connected to WiFI before calling this method.

Parameters
in
info
converter

◆ begin() [3/3]

void audio_tools::AudioEncoderServer::begin ( Stream in,
int  sample_rate,
int  channels,
int  bits_per_sample = 16,
BaseConverter< int16_t > *  converter = nullptr 
)
inline

Start the server. You need to be connected to WiFI before calling this method.

Parameters
in
sample_rate
channels

◆ sendReplyContent()

virtual void audio_tools::AudioEncoderServer::sendReplyContent ( )
inlineprotectedvirtual

Reimplemented from audio_tools::AudioServer.


The documentation for this class was generated from the following file: