arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

We can write PCM data to the RTSPOutput. This is encoded by the indicated encoder (e.g. SBCEncoder) and can be consumed by a RTSPServer. You have to make sure that the codec supports the provided audio format: e.g. GSM support only 8000 samples per second with one channel. Depends on the https://github.com/pschatzmann/Micro-RTSP-Audio/ library. More...

#include <RTSP.h>

Inheritance diagram for RTSPOutput:
AudioOutput Print AudioInfoSupport AudioInfoSource

Public Member Functions

 RTSPOutput (int buffer_size=1024)
 Construcor using RTSPFormatPCM and no encoder.
 
 RTSPOutput (RTSPFormatAudioTools &format, AudioEncoder &encoder, int buffer_size=1024 *2)
 Default constructor.
 
virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
 
virtual AudioInfo audioInfo () override
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
 
int availableForWrite ()
 
bool begin ()
 
bool begin (AudioInfo info)
 
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
 
void end ()
 
virtual void flush ()
 
virtual bool isDeletable ()
 If true we need to release the related memory in the destructor.
 
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
 
 operator bool ()
 Returns true if the server has been started.
 
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
 
virtual void setAudioInfo (AudioInfo newInfo) override
 Defines the input AudioInfo.
 
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active)
 
AudioStreamer * streamer ()
 
size_t write (const uint8_t *data, size_t len) override
 
virtual size_t write (uint8_t ch) override
 
virtual void writeSilence (size_t len)
 

Protected Member Functions

void notifyAudioChange (AudioInfo info)
 

Protected Attributes

int _timeout = 10
 
RingBufferStream buffer {0}
 
AudioInfo cfg
 
CopyEncoder copy_encoder
 
bool is_active = false
 
bool is_notify_active = true
 
Vector< AudioInfoSupport * > notify_vector
 
AudioEncoderp_encoder = &copy_encoder
 
RTSPFormatAudioToolsp_format = &pcm
 
AudioStreamp_input = &buffer
 
RTSPFormatPCM pcm
 
RTSPSourceFromAudioStream rtps_source
 
AudioStreamer rtsp_streamer
 
SingleBuffer< uint8_t > tmp {MAX_SINGLE_CHARS}
 
int tmpPos = 0
 

Detailed Description

We can write PCM data to the RTSPOutput. This is encoded by the indicated encoder (e.g. SBCEncoder) and can be consumed by a RTSPServer. You have to make sure that the codec supports the provided audio format: e.g. GSM support only 8000 samples per second with one channel. Depends on the https://github.com/pschatzmann/Micro-RTSP-Audio/ library.

Author
Phil Schatzmann

Member Function Documentation

◆ availableForWrite()

int availableForWrite ( )
inlinevirtual

We do not know exactly how much we can write because the encoded audio is using less space. But providing the available buffer should cover the worst case.

Reimplemented from AudioOutput.

◆ write()

size_t write ( const uint8_t *  data,
size_t  len 
)
inlineoverridevirtual

We write PCM data which is encoded on the fly by the indicated encoder. This data is provided by the IAudioSource

Implements AudioOutput.

◆ writeSilence()

virtual void writeSilence ( size_t  len)
inlinevirtualinherited

Writes n 0 values (= silence)

Parameters
len

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