Getting Error in the code on using RF24 Audio library.

Hello Guys,

I was trying to send human voice from one to another node. I am using nRF24L01 and Arduino Uno boards. I followed the schematic as explained in http://tmrh20.github.io/RF24Audio/.
Also I have downloaded RF24 Audio library from GitHub - nRF24/RF24Audio: Arduino library for streaming data/audio from analog inputs via NRF24L01 modules.

Now I am getting some errors in the code.
Whene I run the examples from the library, it gives me error as below.

/*"
C:\Program Files (x86)\Arduino\libraries\RF24Audio-master\RF24Audio.cpp: In function 'void __vector_11()':
C:\Program Files (x86)\Arduino\libraries\RF24Audio-master\RF24Audio.cpp:460:4: error: 'radio' was not declared in this scope
radio.writeFast(&buffer,32);
^

Error compiling."*/

It is giving me this error in all the library examples.
Can you help me to solve this error.

its kind of very urgent.

Thank you

its kind of very urgent.

So urgent, you didn't have time to post your code.

Sorry,

In my post I have mentioned that I am using RF24 Audio library examples. I am getting the above error in those examples. The code is as below.

  • RF24 Audio Library TMRh20 2014

This sketch is intended to demonstrate the basic functionality of the audio library.

Requirements:
2 Arduinos (Uno,Nano,Mega, etc supported)
2 NRF24LO1 Radio Modules
1 or more input devices (microphone, ipod, etc)
1 or more output devices (speaker, amplifier, etc)

Setup:

  1. Change the CE,CS pins below to match your chosen pins (I use 7,8 on 328 boards, and 48,49 on Mega boards)
  2. Upload this sketch to two or more devices
  3. Send serial commands via the serial monitor to control transmission and volume (volume only affects receiving devices)

Default Pin Selections:
Speaker: pins 9,10 on UNO, Nano, pins 11,12 on Mega 2560
Input/Microphone: Analog pin A0 on all boards

*/

#include <RF24.h>
#include <SPI.h>
#include <RF24Audio.h>
#include "printf.h" // General includes for radio and audio lib

RF24 radio(7,8); // Set radio up using pins 7 (CE) 8 (CS)
RF24Audio rfAudio(radio,1); // Set up the audio using the radio, and set to radio number 0

void setup() {
Serial.begin(115200); // Enable Arduino serial library

printf_begin(); // Radio library uses printf to output debug info
radio.begin(); // Must start the radio here, only if we want to print debug info
radio.printDetails(); // Print the info

rfAudio.begin(); // Start up the radio and audio libararies
}

void loop() {

if(Serial.available()){ // Receive and analyze incoming serial data
switch(Serial.read()){
case 'r': rfAudio.transmit(); break; // Send an r or an s over serial to control playback
case 's': rfAudio.receive(); break;
case '=': rfAudio.volume(1); break; // Control volume by sending = or - over serial
case '-': rfAudio.volume(0); break;
}
}
Serial.println("test");
delay(1000);
}

/* Documentation and References:

References:
All Library documentation: http://tmrh20.github.io/
New (2014) RF24 Audio Library: GitHub - nRF24/RF24Audio: Arduino library for streaming data/audio from analog inputs via NRF24L01 modules
Optimized (2014) RF24 Lib Source Code: GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices
Optimized (2014) RF24 Network Lib: GitHub - nRF24/RF24Network: OSI Layer 3 Networking for nRF24L01(+) Radios on Arduino and Raspberry Pi

*/

Please check the code and let me know.

Thank you.

Hello guys,

Does anyone knows how to solve this?

please help!!!

so i got this error also and i know this isn't going to be much help but id like to share what i did so others might be able to avoid this too. i'm just an undergraduate so an exact explanation of why you got that error isn't something i feel i can comfortably give.

basically i had to go back into my downloads and open up the cpp file which is the c++ file. i looked on the site i got the liabilities (RF audio) and looked into the c++ files. used crtl f and search the function by name. ended up finding it and it was using a write function not declared or used anywhere else. but there were other write functions that did the same thing. so instead of having the c code say "fastwrite" i changed it to just "write". i did this by opening up the c code in atmel studios 6.2 and going to that function, changing the "fastwrite" to just "write" and saving it. then i re-downloaded the libraries to arduino and compiled it and i didn't get the error again. i compiled all the examples also that use the RFaudio libraries and they complied too.

i am not saying this is the absolute way to fix it as i am new to arduino (i am used to atmel but i have to use arduino because the RF libraries are what i need and there are plenty of examples online so i might as well). I got this error yesterday and this probably means nothing to the one who posted the error but i guess this is a suggestion for those who come across this error again. although i recommend consulting someone like a lecture or someone who knows arduino pretty well over just fully trusting this post.