arduino-audio-tools
|
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>
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 |
AudioEncoder * | p_encoder = ©_encoder |
RTSPFormatAudioTools * | p_format = &pcm |
AudioStream * | p_input = &buffer |
RTSPFormatPCM | pcm |
RTSPSourceFromAudioStream | rtps_source |
AudioStreamer | rtsp_streamer |
SingleBuffer< uint8_t > | tmp {MAX_SINGLE_CHARS} |
int | tmpPos = 0 |
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.
|
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.
|
inlineoverridevirtual |
We write PCM data which is encoded on the fly by the indicated encoder. This data is provided by the IAudioSource
Implements AudioOutput.
|
inlinevirtualinherited |
Writes n 0 values (= silence)
len |