Results 1 to 9 of 9

Thread: Create audio delay

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Create audio delay

    Hi Guys

    Does anyone here know of a way to create an adjustable delay for audio?

    The goal is to be able to have a program which can delay audio output by an adjustable amount from 0 to a few hundred milliseconds.
    This would need to work with audio that comes in on line in and the output would be delayed. It would be ideal if it could also delay audio from other software such as media player. netflix, ect.

    The reason for this is for use with a projector system which has a small delay on the video and causes the voice and lips to be a little out of sync, sometimes just a tiny bit other times a bit more. WOuld be nice to be able to sync this up for a better viewing experience. I have saw software for sale online that claims to do this so I am thinking there should be a way.

    Anyone have any ideas?

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Create audio delay

    This projector, is it playing some kind of audio file ? Its possible that the file itself is out of sync. I'd pursue a solution like that or any other to avoid going the way you're proposing. I have little experience with audio in terms of programming but my instincts tell me that this approach is going to get frustrating very fast. It may involve dealing with drivers and such since sound is such an integrated part of the Windows OS, of course I'm speculating. You're a very good programmer and I'm sure if it was simple or even moderately, you would have already been on your way to a solution. Maybe someone else knows more about this. GL
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Create audio delay

    The audio source here could be live TV, a recorded program, a DVD, an AVI or Streaming video. It could come from any of 3 devices, the PC, Satelite box or DVD player. The unit is a DLP projector that is currently configured to show a picture that is roughly 144 inch at 1080P, This is a little over 10 feet wide and 6 feet high when showing 1080P full screen. There is an audio in and out for the PC as well as HDMI ports for the other devices. All audio comes through the audio out so I can connect the audio out to the line in on the PC then connect the PC out to the sound system. The thought is that if I could delay the audio on the PC by an adjustable amount I could sync the lips with the voice on any program even those where the audio is out of sync normally.

    The projector itself creates a small lag during video processing of about 100ms which is enough to be slightly out of sync but not that bad. On some programs the delay is more pronounced and is annoying so would be great to have a solution that could adjust the audio stream to match. There is hardware that can do this but what I have found so far is in the $200-$300 range and I would rather not spend the money if I can get around it. I also found some software online that is supposed to be able to do this but I have not tested it yet.

    Am hoping someone has an idea how to go about this.

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Create audio delay

    It sounds like the projector itself is the culprit. It projects the image too late. I would recommend getting a different projector or perhaps the projector you're using has settings that could you could adjust to reduce this lag. Trying to write a program to delay the audio may be a head ache inducing task because it would be very low level stuff. It may even be impossible. Sorry I couldn't offer a better solution.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Create audio delay

    Unfortunately from what I have read this is not uncommon for projector systems. Some Blue Ray players have a built in sync adjustment as does VLC player. So another projector would not likely be a solution and they carry a price tag as well.

    On most shows it is not an issue so I may not worry about it but worst comes to worst I can buy a piece of hardware that does this I would just rather not spend the extra cash right now.

    Perhaps I will go over to Code Guru and place a post in the C++ forum, that area gets a lot of traffic and has some pretty sharp programmers in it. C++ is more likely to be able to handle this, if only I can find someone who knows about this stuff and is willing to lend a hand.


    Thanks for the response

  6. #6
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Create audio delay

    Aite, good luck
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  7. #7
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Create audio delay

    If you are not afraid of some api's have a look into "winmm.dll". With this you can capture sound into arrays and send it to your soundcard out.
    Also with XNA are some options to capture and send it out again.
    Fot delaying I advise to use a circulair buffer. The distance between storing and reading, in this buffer, defines the delay.
    I can dive into my archive of VB6 but have no VB6 running anymore.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Create audio delay

    Interesting, I have no problems using an API I also have XNA installed under VS2010 and have VB6 Enterprise installed as well. If you have any sample would be very helpful.

  9. #9
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Create audio delay

    Have a look at this. Its a DTMF-coder and a DTMF-decoder I once wrote.
    The coder sends DTMF beeps via the sound card out and the decoder can receive the beeps via line/mic.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width