Go Down

Topic: Is this even possible? (~7 second audio delay) (Read 1 time) previous topic - next topic


I'm affiliated with a rather poor non-profit radio station. In our main studio, we have a digital 7 second broadcast delay setup, so that if anyone drops profanity on the air, we can hit a dump button and keep either the last 3.5 or 7 seconds from being broadcast. In our remote studio a half mile away, however, we don't have any sort of trigger for that system, so essentially we would have to have someone sitting near the dump button back at the main studio all times. We don't have the manpower, nor the time to do that. What I'm wondering is if there is a way with an arduino (or multiple arduinos) or similar setup to input a 80hz-14khz audio signal, buffer it for 7 seconds, and then output it. The only things it would need to have other than that would be a button that took the signal buffer and dumped it from memory, and then started buffering the delay again. The reason I'm asking is the CHEAPEST I can find a digital, professionally-made, dedicated delay setup is around $700. Our budget doesn't cover that kind of expense, especially after having 3 of our 4 $300 Marantz reporter-recorders "walk off" on us in the last several months.  :'(

Could I do this with several boards?

Coding Badly

Time for a bit of math.  According to Nyquist, you'll need 14,000 * 2 samples per second = 28,000 samples per second.  About the lowest resolution you'd want to consider is 12 bits per sample which gives us 336,000 bits per second or 42,000 bytes per second.  I believe the maximum memory available on an AVR processor is 64K.  You may be able to buffer 1.5 seconds.  So, you'll have to consider a solution with external memory.  

You'll need an external DAC (available as a shield) and may need an external ADC.

Still interested?


The first thing you would need to do is figure out what sampling rate you want to use to record the incoming signal. Then, determine if the ADC on the Arduino is fast enough to collect that number of samples. For any reasonable level of accuracy for sampling audio data, it is not.

Then, you need to determine how much space it will take to store 7 seconds of samples. For any reasonable level of accuracy for sampling audio data, that's a lot of samples. Far more than the poor little Arduino can hold in memory at one time. Even the Mega 2560 only has 8K of SRAM for all global variables, constants, and stack space.

Then, you need to convert the sampled/stored input data into some useful format.

If you want to chop 3.5 seconds out of the data being streamed out, that leaves you with 3.5 seconds of data. If you chop another 3.5 seconds, you are no longer storing anything. How do commercial devices handle this?

Break the legs on the last one you have, so it doesn't walk off, too.


Nov 11, 2010, 10:17 pm Last Edit: Nov 11, 2010, 10:19 pm by dannywilson Reason: 1
I am willing to deal with external memory, and I was already considering The DAC and ADC idea. The way I was thinking was this: 3 Arduinos, mainly to share the load of the processing this is probably going to take:

SOUND SOURCE -> Arduino with analog to digital converter -> Arduino with external flash memory -> Arduino with digital to analog converter -> SOUND OUTPUT

Does this work like this? Sending a data signal from one arduino to another?


Here you can find some audio effects implemented on a ATTiny26 with external RAM:
As the tiny is a lot less powerful than an atmega I think this is a good base to build upon. On the other hand, as it was mentioned before - what audio quality do you want to record. If it is a phone audio, it might do the job, but if you want to buffer high quality audio it might not.
What about using a PC for that?

Go Up