|
arduino-audio-tools
|
NRF24L01(+) Stream for sending and receiving audio via the nRF24L01 2.4GHz radio module. Optimized for low-latency, high-throughput audio with small 32-byte packets. More...
#include <NRF24Stream.h>
Public Member Functions | |
| NRF24Stream ()=default | |
| Default constructor. | |
| NRF24Stream (BaseBuffer< uint8_t > &buffer) | |
| Constructor with an external receive buffer. | |
| NRF24Stream (RF24 &radio) | |
| Constructor with an externally created RF24 object. | |
| NRF24Stream (RF24 &radio, BaseBuffer< uint8_t > &buffer) | |
| Constructor with an externally created RF24 object and receive buffer. | |
| 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 () override |
| Returns the number of bytes available to read. | |
| int | availableForWrite () override |
| Returns the number of bytes available to write. | |
| bool | begin () override |
| Initializes the radio hardware and configures TX or RX mode. | |
| bool | begin (NRF24Config config) |
| Starts the stream with the given configuration. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| NRF24Config | defaultConfig (RxTxMode mode=TX_MODE) |
| Returns the default configuration for the given mode. | |
| void | end () override |
| Stops the radio and releases resources. | |
| virtual void | flush () override |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| RF24 * | radio () |
| Provides access to the RF24 radio object for advanced configuration. | |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Reads received audio data from the RX buffer. | |
| 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 |
| Updates the audio info and propagates to the base class. | |
| void | setBuffer (BaseBuffer< uint8_t > &buffer) |
| Sets an external receive buffer. | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setWriteBufferSize (int size) |
| size_t | write (const uint8_t *data, size_t len) override |
| Writes audio data, buffering into payload-sized packets for transmission. | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| void | fillBuffer () |
| Drains all available radio packets into the RX buffer. | |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
Protected Attributes | |
| int | _timeout = 10 |
| NRF24Config | cfg |
| RingBuffer< uint8_t > | default_rx_buffer {0} |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| RF24 * | p_own_radio = nullptr |
| RF24 * | p_radio = nullptr |
| BaseBuffer< uint8_t > * | p_rx_buffer = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| SingleBuffer< uint8_t > | tx_buffer |
| int | write_buffer_size = MAX_SINGLE_CHARS |
NRF24L01(+) Stream for sending and receiving audio via the nRF24L01 2.4GHz radio module. Optimized for low-latency, high-throughput audio with small 32-byte packets.
Works across Teensy, ESP32, Arduino Nano (including variants with integrated nRF24), and other platforms supported by the RF24 library.
|
default |
Default constructor.
|
inline |
Constructor with an externally created RF24 object.
|
inline |
Constructor with an external receive buffer.
|
inline |
Constructor with an externally created RF24 object and receive buffer.
|
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.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
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, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
Returns the number of bytes available to read.
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Returns the number of bytes available to write.
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Initializes the radio hardware and configures TX or RX mode.
Reimplemented from BaseStream.
|
inline |
Starts the stream with the given configuration.
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
Returns the default configuration for the given mode.
|
inlineoverridevirtual |
Stops the radio and releases resources.
Reimplemented from BaseStream.
|
inlineprotected |
Drains all available radio packets into the RX buffer.
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
|
inline |
Provides access to the RF24 radio object for advanced configuration.
Reads received audio data from the RX buffer.
Reimplemented from AudioStream.
Source to generate silence: just sets the buffer to 0.
|
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 >.
Updates the audio info and propagates to the base class.
Reimplemented from AudioStream.
|
inline |
Sets an external receive buffer.
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
Writes audio data, buffering into payload-sized packets for transmission.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |