arduino-audio-tools
Public 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 AudioInfo audioInfo () override
 
int availableForWrite ()
 
bool begin ()
 
bool begin (AudioInfo info)
 
void end ()
 
virtual void flush () override
 
virtual bool isDeletable ()
 If true we need to release the related memory in the destructor.
 
 operator bool ()
 
 operator boolean ()
 Returns true if the server has been started.
 
virtual void setAudioInfo (AudioInfo info) override
 
virtual void setNotifyAudioChange (AudioInfoSupport &bi) override
 
AudioStreamer * streamer ()
 
virtual bool validate (AudioInfo &info)
 
size_t write (const uint8_t *buffer, size_t byteCount) override
 
virtual size_t write (uint8_t ch) override
 
virtual void writeSilence (size_t len)
 

Protected Attributes

int _timeout = 10
 
RingBufferStream buffer {0}
 
AudioInfo cfg
 
CopyEncoder copy_encoder
 
bool is_active = false
 
AudioEncoderp_encoder = &copy_encoder
 
RTSPFormatAudioToolsp_format = &pcm
 
AudioStreamp_input = &buffer
 
AudioInfoSupportp_notify = nullptr
 
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 *  buffer,
size_t  byteCount 
)
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: