[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xaudio-sdk
Subject:    [xaudio-sdk] TimeCode-messages are one second too early
From:       "Jasper Kalkers" <jkalkers () hetnet ! nl>
Date:       2001-05-07 18:43:11
[Download RAW message or body]

I've been succefull in making a mp3-player with a playlist using the XAudio
sdk in Delphi 5 using Xaudio 3.2.9.5. It was easy and it worked great. I've
noticed (like several others in this list) that an EOF-message comes one
second before the end of a song. That causes my player to display the
transition to the next song one second before the next song actually starts.
I have no problem with the sound (the songs follow each other seamlessly).

My real problem is that Xaudio sends Timecode-messages one second too early.
My player displays the current time of a song (just like the
Delphi-example). When I start a song, it doesn't start with 0:00, but with
0:01. At the end of the song, the last second the timer pauses. From earlier
discussions I've read about this subject I understand this problem is caused
by the buffer (which contains one second of sound). The Timecode-messages
are sent when the stream is decoded.

Until now, this was only a small problem for me. Lately I've been working on
support for synchronized lyrics stored in ID3v2. The lyrics (not
surprisingly) were displayed one second to early! I can work around this
problem by subtrackting one second of the time reported by XAudio, but in
that way I can never synchronize with any text in the last second (imagine
what happens when the buffer becomes larger). Neither will that solution
work for the timer-display, because XAudio does not send Timecode-messages
during the last second of the song.

This leaves me with two questions/remarks:

To the XAudio developers:
Could you please make XAudio send Timecode-messages that are synchronous to
the sound that is played. It may be a solution to provide seperate messages
for the Input-module and for the Output-module. I could use an
InputEOF-message to open a new mp3-file and use the OutputEOF-message to
refresh the User-interface. For the timer-display I could use the
OutputTimeCode-events, the InputTimeCode-messages could stay for
compatibility.

To any user of the Xaudio sdk:
Does anyone has better ideas to work around my problem?

Jasper Kalkers
The Netherlands

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2>
<DIV>I've been succefull in making a mp3-player with a playlist using the XAudio 
sdk in Delphi 5 using Xaudio 3.2.9.5. It was easy and it worked great. I've 
noticed (like several others in this list) that an EOF-message comes one second 
before the end of a song. That causes my player to display the&nbsp;transition 
to the next song one second before the next song actually starts. I have no 
problem with the sound (the songs follow each other seamlessly). <BR><BR>My real 
problem is that&nbsp;Xaudio sends Timecode-messages one second too early. My 
player displays the current time of a song (just like the Delphi-example). When 
I start a song, it doesn't start with 0:00, but with 0:01. At the end of the 
song, the last second the timer pauses. From earlier discussions I've read about 
this subject I understand this problem is caused by the buffer (which contains 
one second of sound). The Timecode-messages are sent when the stream is 
decoded.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Until now, this was only a small problem&nbsp;for me. Lately I've been 
working on support for synchronized lyrics&nbsp;stored in ID3v2. The lyrics (not 
surprisingly) were displayed one second to early! I can work around this problem 
by subtrackting one second of the time reported by XAudio, but in that way I can 
never synchronize with any text in the last second (imagine what happens when 
the buffer becomes larger). Neither will that solution work for the 
timer-display, because XAudio does not send Timecode-messages during the last 
second of the song.</DIV>
<DIV>&nbsp;</DIV>
<DIV>This leaves me with two questions/remarks:</DIV>
<DIV>&nbsp;</DIV>
<DIV>To the XAudio developers:</DIV>
<DIV>Could you please make XAudio send Timecode-messages that are synchronous to 
the sound that is played. It may be a solution to provide seperate messages for 
the Input-module and for the Output-module. I could use an InputEOF-message to 
open a new mp3-file and use the OutputEOF-message to refresh the User-interface. 
For the timer-display&nbsp;I could use the OutputTimeCode-events, the 
InputTimeCode-messages could stay for compatibility.</DIV>
<DIV>&nbsp;</DIV>
<DIV>To any user of the Xaudio sdk:</DIV>
<DIV>Does anyone has better ideas to work around my problem?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Jasper Kalkers</DIV>
<DIV>The Netherlands</DIV></FONT></DIV></BODY></HTML>

_______________________________________________
xaudio-sdk mailing list
xaudio-sdk@mpegtv.com
http://mailman.bok.net/mailman/listinfo/xaudio-sdk


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic