0

Audio lags when video is started and video zooms



Hello. I run the following script on a HD2000, with a display connected to the VGA.

1 vm = CreateObject("roVideoMode") vm.SetMode("1024x768x60p") v = CreateObject("roVideoPlayer") v.SetAudioOutput(0) v.MapStereoOutput(2) a1 = CreateObject("roAudioPlayer") a1.SetAudioOutput(0) a1.MapStereoOutput(1) gpio = CreateObject("roGpioControlPort") p = CreateObject("roMessagePort") v.SetPort(p) a1.SetPort(p) gpio.SetPort(p) event_loop: 'Vent paa events msg=wait(0, p) if type(msg)="roGpioButton" then button = msg.GetInt() if button = 0 then ok = v.PlayFile("/dansk.avi") else if button = 1 then ok = v.PlayFile("/engelsk.avi") else if button = 2 then ok = v.PlayFile("/tysk.avi") REM AUDIO 1 else if button = 3 then ok = a1.PlayFile("/1_dansk.mp3") else if button = 4 then ok = a1.PlayFile("/1_engelsk.mp3") else if button = 5 then ok = a1.PlayFile("/1_tysk.mp3") endif endif clear_events: msg=p.GetMessage():if type(msg)<>"rotINT32" then clear_events goto event_loop [/code]

All is fine and dandy at first. But, if a sound is played through a1 and I start a video there is a little glitch in the audio. On the other hand, if a video is playing and i start some audio, the video is actually zoomed to the upper left corner, so some of the video is missing!

3 comments

  • 0
    Avatar
    RokuLyndon


    I forgot to post my reply here.



    For the audio lagging, please verify the audio for all files is 48k.



    For the video zoom problem, I don't see the problem if I change the script so that the audio from the video file goes to spdif, leaving the mp3s still on the analog audio ports.
  • 0
    Avatar
    ichv


    I just tried this script, mapping audio output of the video to the

    SPDIF, but same thing happens:



    p = CreateObject("roMessagePort")

    v = CreateObject("roVideoPlayer")
    v.SetAudioOutput(2)

    a = CreateObject("roAudioPlayer")
    a.SetAudioOutput(0)
    a.MapStereoOutput(1)

    ok = v.PlayFile("/engelsk.avi")

    wait(4000,p)

    ok = a.PlayFile("/1_dansk.mp3")

    el:
    msg = wait(0,p)
    goto el

  • 0
    Avatar
    RokuLyndon


    I saw your email indicating this had been fixed. What did you change?
Please sign in to leave a comment.