View Full Version : time shifting audio


miatawnt2b
08-07-07, 11:08 AM
I'm sure this has come up before, but I am having no luck with the search at the moment. I would like to be able to sync an fm radio broadcast with my HD so that I can listen to my local sports announcers while watching the network video. Our radio is usually 2-5 seconds ahead of the video. What I would like to be able to do is pipe the analog audio into the line-in of my laptop (ubuntu), have a piece of software where I can set a delay, and pipe it back out the line-out. Ideally the software would have the capability of allowing me to vary the delay in real time, as the broadcast delay can shift a half second or so between commercials.

I'm sure I'm not the only one who has wanted to listen to local play-by-play... does this exist?

-thanks,
-J

waterhead
08-07-07, 05:30 PM
You want something like this:

http://www.motron.com/RadioTVsync.html
http://www.sportsyncradio.com/
http://delayplay.com/index.htm

I think that there may be other manufacturers of similar devices.

waterhead
08-07-07, 05:46 PM
I also found this free program:

http://www.daansystems.com/freestuff/

Unfortunately, it is a windows application. I just ran it in Linux with Wine, but I don't have any inputs to try it out.

miatawnt2b
08-08-07, 07:52 AM
I also found this free program:

http://www.daansystems.com/freestuff/

Unfortunately, it is a windows application. I just ran it in Linux with Wine, but I don't have any inputs to try it out.

I also saw this. When I tried to press the 'play' button it crashed under wine. I did find a program called audiofutbol, which too is a windows app, but it wouldn't even launch under wine.

-J

able421
08-08-07, 01:12 PM
I can't post links yet, but I found one called the Alchemy˛ D˛L Digital Delay Line.

Also, the best google challenge seem to be "digital delay line," "A/V sync," or something to do with "lip sync." It seems that some home theater audio receivers also have this feature. I even found algorithms for writing them in C on a personal web page at Stanford.

CT_Wiebe
08-08-07, 02:49 PM
waterhead -- Paul, your first reference (http://www.motron.com/RadioTVsync.html) seems to be the best for the OP's purpose - my judgment only.

able421 -- You could try posting an address using the word "dot" (and spaces) to provide the link. I tried the "digital delay line" search and came up with a lot of interesting stuff, most of which is either not applicable or expensive.

Your reference to an algorithm in C sounds like it would be useful (if it can be adapted to provide delays in seconds - most of those are millisecond types of functions, IIRC). I haven't found that Stanford link yet.

able421
08-08-07, 02:53 PM
I don't have enough posts yet to submit a link, so you'll have to piece this back together (remove spaces):

ccrma. stan ford .e du / ~jo s / Del ay/ De lay_ lines . ht ml

I haven't read through the code, but my guess is you'd need the ability to buffer a lot of data, at least temporarily. But I really couldn't say having never coded audio or embedded systems.

CT_Wiebe
08-08-07, 03:35 PM
Thanks. You left out one letter, however. The link is: http://ccrma.stanford.edu/~jos/Delay/Delay_Line_C.html. That's sort of what I thought it would be. Unfortunately, to get an implementation (for this application) is very impractical, since the amount of delay is PC clock speed dependent and would only be semi-practical, for long delays, if one uses a slow hard drive as the buffer device. I ran across a similar C coding function in an exercise in a C++ class that I took about 20 years ago.

The whole paper can be downloaded as "Delay.pdf" from the link provided at the bottom of the page I linked to.

The main page for the entire research project is here: http://ccrma.stanford.edu/realsimple/.

I still think that the Motron Audio Delay box, that Paul referenced, is the more practical implementation for delaying a simulcast radio broadcast to sync up with the TV version. The other 2 seem like very cheap implementations that wouldn't really work very well for the job at hand.

tji
08-08-07, 04:13 PM
Griffin Radio Shark ( http://www.griffintechnology.com/products/radioshark/ ) can do time shifting. It can also do basic radio-DVR (DAR?) functions, with auto-import into iTunes on Mac OS or Windows.

It also works in Linux, after a little tweaking. I had mine set up to auto-record a few radio programs, and convert to MP3/AAC. I have seen descriptions of others setting theirs up in Linux for streaming - so you would just control the amount of delay in the playback app.

waterhead
08-08-07, 05:18 PM
That's the one that I was thinking about! I knew that there was at least one more.

I see that the original model has been superseded by a newer model. A check on eBay shows the original going for less than $10! I may even get one, for when I watch Green Bay Packer games. I hate the network announcers.

nitrogen
08-08-07, 10:36 PM
Wow, there are much simpler ways to do this. Delays are used all the time in music and audio production, and are an essential element of any software synthesis package. All you need to do is run something that can load LADSPA plugins (jackrack, spiralsynthmodular, alsamodularsynth, custom .asoundrc, etc.), add in a delay, make sure your inputs and outputs are selected, and set the delay time. It doesn't depend on the clock speed of your computer, it doesn't buffer data to the hard drive. One audio CD is ~800MB of data for ~74mins of audio. If you're talking about just a few seconds of audio to match TV broadcast delay, it's a piece of cake. Delays are really easy to code, too, using either a circular buffer with separate read and write positions (with the read offset adjustable to set the delay time) or with a dynamically reallocated double buffered system. I even modified a simple delay to run on SB Live cards once, to sync live audio with the delayed video from tvtime.

If you want to adjust the delay time on the fly, you can find a fractionally-addressed delay line LADSPA plugin that instead of making a jumping or popping noise when you adjust the delay, will actually momentarily speed up or slow down the audio.