|
arduino-audio-tools
|
VBAN Audio Source and Sink for the ESP32. For further details please see https://vb-audio.com/Voicemeeter/vban.htm . Inspired by https://github.com/rkinnett/ESP32-VBAN-Audio-Source/tree/master and https://github.com/rkinnett/ESP32-VBAN-Network-Audio-Player. More...
#include <VBANStream.h>


Public Member Functions | |
| 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 () |
| int | available () |
| int | availableForWrite () |
| bool | begin () |
| bool | begin (VBANConfig cfg) |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| VBANConfig | defaultConfig (RxTxMode mode=TX_MODE) |
| virtual void | end () |
| virtual void | flush () override |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| size_t | readBytes (uint8_t *data, size_t len) override |
| virtual size_t | readSilence (uint8_t *buffer, size_t length) |
| Source to generate silence: just sets the buffer to 0. | |
| virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| void | setAudioInfo (AudioInfo info) override |
| Defines the input AudioInfo. | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setOutput (Print &out) |
| void | setWriteBufferSize (int size) |
| 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) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| bool | begin_rx () |
| bool | begin_tx () |
| bool | configure_tx () |
| void | configure_vban (VBanSampleRates rate) |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | receive_udp (AsyncUDPPacket &packet) |
| VBAN adjusts the number of samples per packet according to sample rate. Assuming 16-bit PCM mono, sample rates 11025, 22050, 44100, and 88200 yield packets containing 64, 128, 256, and 256 samples per packet, respectively. The even-thousands sample rates below 48000 yield non-power-of-2 lengths. For example, sample rate 24000 yields 139 samples per packet. This VBAN->DMA->DAC method seems to require the dma buffer length be set equal to the number of samples in each VBAN packet. ESP32 I2S/DMA does not seem to handle non-power-of-2 buffer lengths well. Sample rate 24000 doesn't work reliably at all. Sample rate 32000 is stable but stutters. Recommend selecting from sample rates 11025, 22050, 44100, and above And set samplesPerPacket to 64 for 11025, 128 for 22050, or 256 for all else. | |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| void | safe_strncpy (char *dest, const char *src, size_t dest_size) |
| void | sendVbanPing0Reply (AsyncUDPPacket &sourcePacket) |
| void | start_wifi () |
| const char * | toString (IPAddress adr) |
| int | vban_sample_rate () |
Protected Attributes | |
| int | _timeout = 10 |
| bool | available_active = false |
| const IPAddress | broadcast_address {0, 0, 0, 0} |
| size_t | bytes_received = 0 |
| VBANConfig | cfg |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| Print * | p_out = nullptr |
| uint32_t | packet_counter = 0 |
| BufferRTOS< uint8_t > | rx_buffer { 0} |
| Throttle | throttle |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| SingleBuffer< int16_t > | tx_buffer {0} |
| AsyncUDP | udp |
| bool | udp_connected = false |
| VBan | vban |
| int | write_buffer_size = MAX_SINGLE_CHARS |
VBAN Audio Source and Sink for the ESP32. For further details please see https://vb-audio.com/Voicemeeter/vban.htm . Inspired by https://github.com/rkinnett/ESP32-VBAN-Audio-Source/tree/master and https://github.com/rkinnett/ESP32-VBAN-Network-Audio-Player.
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in MP3EncoderShine, PureDataStream, PWMAudioOutput< PWMDriverT >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
|
inlinevirtual |
Reimplemented from BaseStream.
|
inlinevirtual |
Reimplemented from BaseStream.
|
inlinevirtual |
Reimplemented from BaseStream.
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inlinevirtualinherited |
Reimplemented in FaustStream< DSP >, AudioMP34DT05, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, VS1053Stream, WM8960Stream, AdaptiveResamplingStream, AudioLoRa, ESPNowStream, BufferedTaskStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, USBAudioDeviceBase, USBAudioHostBase, GoertzelStream, Equalizer3BandsT< T >, I2SStream, AudioStreamWrapper, TimerCallbackAudioStream, FormatConverterStream, FileLoopT< FileType >, FileLoopT< File >, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, EncodedAudioStream, AudioKitStream, MiniAudioStream, PortAudioStream, StdioStream, A2DPStream, BLESerialClientArduinoBLE, BLESerialClientESP32, BLESerialServerArduinoBLE, BLESerialServerESP32, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, URLStreamESP32, NRF24Stream, SPIAudioSlave, SPIRegAudioSlave, AutomaticGainControlStream, VolumeStream, AnalogAudioStream, AudioEffectStreamT< T >, AudioEffectStream, Equalizer3BandsPerChannelT< T >, ReformatBaseStream, AdapterAudioOutputToAudioStream, MemoryStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, InputMixer< T, SumT >, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStream, NumberFormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, Pipeline, Pipeline::ModifyingStreamAdapter, SupportedRatesStream, AudioFFTBase, AbstractURLStream, and BLESerialStream.
|
inlineoverridevirtualinherited |
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, BLESerialClientBase, URLStream, BufferedTaskStream, AutomaticGainControlStream, MeasuringStream, QualityAnalysisStream, VolumeStream, AudioEffectStreamT< T >, AudioEffectStream, Equalizer3BandsT< T >, Equalizer3BandsPerChannelT< T >, I2SStream, TimedStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, QueueStream< T >, QueueStream< uint8_t >, FadeStream, Pipeline::ModifyingStreamAdapter, SupportedRatesStream, and EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >.
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Reimplemented from AudioStream.
Source to generate silence: just sets the buffer to 0.
|
inlineprotected |
VBAN adjusts the number of samples per packet according to sample rate. Assuming 16-bit PCM mono, sample rates 11025, 22050, 44100, and 88200 yield packets containing 64, 128, 256, and 256 samples per packet, respectively. The even-thousands sample rates below 48000 yield non-power-of-2 lengths. For example, sample rate 24000 yields 139 samples per packet. This VBAN->DMA->DAC method seems to require the dma buffer length be set equal to the number of samples in each VBAN packet. ESP32 I2S/DMA does not seem to handle non-power-of-2 buffer lengths well. Sample rate 24000 doesn't work reliably at all. Sample rate 32000 is stable but stutters. Recommend selecting from sample rates 11025, 22050, 44100, and above And set samplesPerPacket to 64 for 11025, 128 for 22050, or 256 for all else.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
Defines the input AudioInfo.
Reimplemented from AudioStream.
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inline |
|
inlineinherited |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |