RF24Audio v1.0
Arduino Audio Streaming Realtime with NRF24L01 radios
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RF24Audio Class Reference

Arduino Realtime Audio Streaming library. More...

#include <RF24Audio.h>

Public Member Functions

 RF24Audio (RF24 &_radio, byte radioNum)
 Setup the radio and radio identifier.
 
void begin ()
 Initialize the radio and audio library.
 
void volume (bool upDn)
 Volume Control.
 
void setVolume (char vol)
 Volume Control.
 
void transmit ()
 Control transmission through code.
 
void receive ()
 Stop transmission through code.
 
void broadcast (byte radioID)
 Control of Private or Public Communication.
 
uint64_t getAddress (byte addressNo)
 Get any of the preset radio addresses.
 
void handleButtons ()
 Handle button inputs.
 

Detailed Description

Arduino Realtime Audio Streaming library.

This class implements an Audio Streaming library using nRF24L01(+) radios driven by the Optimized RF24 library.

Examples
GettingStarted.ino, Minimal.ino, PrivateChannels.ino, and PrivateGroups.ino.

Constructor & Destructor Documentation

◆ RF24Audio()

RF24Audio::RF24Audio ( RF24 &  _radio,
byte  radioNum 
)

Setup the radio and radio identifier.

Note
Changing radioNum is only required if utilizing private node-to-node communication as opposed to broadcasting to the entire radio group
RF24 radio(48, 49); // Initialize the radio driver
RF24Audio rfAudio(radio, 0); // Initialize the audio driver
Arduino Realtime Audio Streaming library.
Definition: RF24Audio.h:22
Parameters
_radioThe underlying radio driver instance
radioNumThe radio identifier

Member Function Documentation

◆ begin()

void RF24Audio::begin ( )

Initialize the radio and audio library.

Generally called in setup to initialize the radio

rfAudio.begin();

◆ broadcast()

void RF24Audio::broadcast ( byte  radioID)

Control of Private or Public Communication.

Call this function to establish private communication between nodes in a radio group, or to switch back to public transmission.

Note
Using a radioID of 255 will disable private communication and broadcast to all nodes
rfAudio.broadcast(1); // Only transmit audio to radio number 1
rfAudio.broadcast(255); // Transmit audio to all radios in the group
Parameters
radioIDSet the radioID of the radio to communicate privately with.

◆ getAddress()

uint64_t RF24Audio::getAddress ( byte  addressNo)

Get any of the preset radio addresses.

Useful for listening nodes who wish to create private or additional radio groups The library has 14 predefined radio addreses. All radios listen/write on the first two addresses (0, 1), and engage a private channel based on the radio number. Radio 0 listens on address 2, Radio 1 on address 3, etc.

uint64_t newAddress = rfAudio.getAddress(3); // Gets the 3rd defined radio address
OR
radio.openReadingPipe(0, rfAudio.getAddress(7)); // Listens on the 7th defined radio address
Parameters
addressNoNumbers 0 through 14 to access any part of the defined address array
Returns
RadioAddress: Returns the requested predefined radio address

◆ handleButtons()

void RF24Audio::handleButtons ( )

Handle button inputs.

Must be called regularly for button functionality

◆ receive()

void RF24Audio::receive ( )

Stop transmission through code.

rfAudio.receive(); // Stop audio streaming

Call this function to stop transmission

◆ setVolume()

void RF24Audio::setVolume ( char  vol)

Volume Control.

rfAudio.setVolume(4); // Set the volume to mid-level
Parameters
volSet at 0 to 7 for range of volume control

◆ transmit()

void RF24Audio::transmit ( )

Control transmission through code.

rfAudio.transmit(); // Begin realtime audio streaming

Call this function to begin transmission

◆ volume()

void RF24Audio::volume ( bool  upDn)

Volume Control.

rfAudio.volume(1); // Raise the volume
Parameters
upDnSet 0 to lower volume, 1 to raise volume

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