New Library: RF24Audio - Realtime Audio Streaming, Multicasting and More

Hello TMRh20,

Very nice project. 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 you have explained in http://tmrh20.github.io/RF24Audio/. Also I have downloaded RF24 Audio library from https://github.com/TMRh20/RF24Audio.

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.

This report would have more information with "Show verbose output during compilation" enabled in File > Preferences."

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

Per the docs, it requires the RF24 driver: https://github.com/TMRh20/RF24

I have experience with arduino but no experience with audio streaming. I want to stream music (mp3) from my PC to my hifi System and I want to build a receiver to plug in headphones. I am not a hifi freak but the stream should not have dropouts. The range is max 15meter and there is one Wall or window Front. Can i use the Rf24audio and the nrf24l01 for my Intention? Or is the quality not good enough? Can i stream every mp3? Which mp3 Decoder Module Do you suggest?

Thanks for help.

no one has a answer?

RF24Audio and the USB_Audio example

Can the radio be decoupled from the audio library if we are not using the radio ?

It would really be nice if the audio aspect of this could be independent. Imagine all we could do with it :wink:

I purchased some RFM69 radios with the intent do implement something like this as part of a bigger project but I found nothing to help me implement the PTT walkie talkie part of it. You library does this, but with different radio and MCU (Atmega32u4).

I’ve been at this for 2 months with very little progress and I’m just about ready to simply by cheap walkie takies and embed them in my project lol

Not sure if you can help but it was worth one last shot before I head to the dollar store… lol

Sid

Balisto: I would say probably not. RF24Audio is only targeted at 328 based devices, which can't really produce high quality audio using on-board timers & PWM. The nrf24l01+ radios can handle transmissions anywhere from about 45KB/s to 200KB/s in streaming mode, so the concept is not out of the question, but it would require a different library and better hardware.

sid1202: I think so, to some degree anyway. It would be a matter of replacing the calls to the RF24 driver with something else, or making a generic setup that could be tied in with any radio device. I probably won't be looking at doing this myself anytime soon, but anybody can modify the code on GitHub.

As long as the radios can handle the data-rate, data just needs to be 'fed' into the buffers. The 32u4 should be supported, I believe the timer registers are the same or very similar to 328s.

There is a setup that uses a RF12B to make a walkie talkie so It should work. Unfortunately I could not find the code. You have to buy the hardware to get the code. Then I found your library. I've been looking for this for a while. I came across many who where looking for this too. But the hardware I already have is a RFM69HCW 915Mhz based board.

I don't think I got the required skill set yet to make the necessary changes to make it work, but I'll definitely look into it. I understand that you have other things to do and don't plan on doing this anytime soon, but be assured that when you do, many people will be happy.

Went the time comes, if I have questions changing the code, may I contact you about it ?

Regards

Sidney

Yeah, to keep track of it just log an issue/enhancement here

Feel free to post questions & code about it there, plus my contact info is on GitHub if needed, but an open issue will remind me of things to work on.

Cool. I need to find a tutorial the help me ramp back up to coding with registers It's been over 12 years so if you have any interesting links please feel free to send them my say. Not as easy to find stuff with google lately, returns all kinds of unrelated results.

Sid

I've been looking at the code and this is out of my league at the moment.

I also saw some people requesting some codec's. I have a suggestion (that I what to open an issue about on GitHub). making the audio sampling driver generic only handling the mic input and speaker output though a buffer.

The constructor could use the F_CPU and have parameters to setup pins for speaker and mic.

A setup or init function could activate different codecs, compression, encryption on the stream and would be easier to maintain.

A config functions could be used to adjust sample rate and could use some predefined rates like min, max, voice, voiceMin (lowest understandable sample rate) etc.

The resulting stream could then be transferred between 2 nodes using what ever method the user wants, could be USB, Bluetooth, radio, WiFi, Ethernet etc...

I wish my coding skill was back up to par so I could do it with you, but I barely understand manipulating the digital pins with the registers and this code relies heavily on ISR's and nested interrupts.

Trying to learn how to program at this low level, I read that I should use AmtelStudio and the new version is quite different that what is suggested in the tutorials I found which adds to the learning curve.

What do you think ? Does it make sense ?

Sidney

Seems to make sense, only I would suggest maybe focusing on one feature at a time though.

I find the hardest part of dealing with register manipulation in AVR devices is going through the documentation. Once you get used to it, things get much easier.

Then if you just think of them as hard-coded 8-bit variables, its simply a matter of knowing which bits to modify to make things happen. You can also use standard arduino functions to modify them.

I generally just use a text editor for programming or the Arduino IDE for Arduino devices.

Hi,

I think I understand the basic of the ports. The use of the timers is what is giving me grief at the moment.

There is a test editor called notepad++ I think, I’ll try to get that.

My project is kinda of on hold right now from a request to build a wireless remote for piece of construction equipment. Tying to find an economical solution to connecting to dirty automotive power when your not an electrical engineer is no small task. Trying to get the protection and the clean power at the same time seems to be something that is missing on the market still.

I’ll need to better understand timers for that project so it will help me with this one later.

Thank you for the pointer.

Sid

Hi ..great project . I am college student and I am doing same project as what u did. So I wanted to know that I am using android phone to give input to preamp circuit but preamp circuit is not working for me .also which transistor and capacitor u use . Second problem is that there r so many codes in link provided by you

https://github.com/TMRh20/RF24Audio/archive/master.zip

I am newbie in coding so please tell me which code I need to upload in transmitter side and which in receiver side

Also I have read all comments in this page. You were taking about uncomment #define speakertx in config.h to get output in transmitter side so after doing this which code I have to upload ....plzzz I have deadline on 29 nov 2016 ...

Too impressive with your project. So how about the sound quality? Comparing to the solution that using a bluetooth speaker and broadcasting from a mobile phone, which one is better?

My apology if my question is silly as I have no experiences with audio.

Hello everyone!
I have similar problem with my nRF’s like I think all of you. This problem is constant noise on the receiver, especially that signal from electret microphone with preamp connected directly to laptop mini-jack port is pretty good. But I’m not surprised at all that the quality od transmission is only passable, considering very simple preamp cicruit, 8-bit ADC and bunch of bad quality connecting wires. But to the point.

My bigger problem is that my receiver Arduino board only works connected on the USB to the laptop. The transmitter works with every type of DC supply, like 9V battery, 5V power bank or 12V (2A) DC power supply. But when I switch sources, the transmission dies. It is not the problem with single Arduino board, or the power source, because when I switch Arduino’s, the problem moves to the other board (still on the receiver). I think I should mention that I use those circuits in simplex communication. If somebody has any idea what could be the couse of the problem, I would be very thankful.

Thanks for help in advance and greetings from Poland!

TMRh20: Well, not really. It may be possible to do so, but would probably be a bit difficult at high bitrates.

Hello, I built a baby monitor with nrf24l01. The microphone level is sent to the parents base and some leds and a buzzer get activated proportional to the sound level. I also get the remote temperature and humidity and display it on a 1.3 oled. I want to upgrade it with audio, but no luck so far. How can I do rfAudio.transmit(); when sound level is above threshold? How can I light the leds like a vu meter?

Is it possible to do all those things + audio? Or using another pair of arduinos/nrfs is required?

Thank you!

I also have similar issues, using the library with other libraries is giving me headache, I tried interfacing it with an RFID card reader, if card is correct then rfAudio.transmit() but non of it gets to work correctly.

hi, I know that this is old but im trying to do this for a school project and im running out of time lol. first of all I want to use it as a wireless guitar transmiter. but i cant transmit anything I plugged pin 9-10 in a oscilloscope and im getting this pwm. the wave never changes when i plug it in a amp I get a constant tone atleast. the tone stays the same no mather what is at at my A0 on my transmiter… im starting to thing that one or both nrf24 are the porbleme but im not sure, but i can send and receive prints so im really not sure there thx in advance.

28459089_1866984503333831_350960858_n.jpg

would you make the zip file for the RF24Audio library available.

I need to understand one thing? How is possible that you can read any type of signal through A0 pin if arduino isn't capable of reading negative values?