hi, i've been working on a rhythm game for awhile and part of the song creator allows the user to skip forwards and backwards through songs. I've ran into an mp3 that when skipped forwards or backwards, the position from bass_channelgetposition does not match the actual sound of the music. included below is a test program i used to replicate this (as my original program is too large for here, but uses the same bass code) and a link to the mp3 in question. the tick console write should occur on every beat of the song but after changing position it gives an incorrect value and goes off sync. when tested with other mp3s it works fine.
class Program
{
public static double position
{
get
{
return Bass.BASS_ChannelBytes2Seconds(handle, Bass.BASS_ChannelGetPosition(handle, BASSMode.BASS_POS_BYTES)) * 1000;
}
set
{
Bass.BASS_ChannelSetPosition(handle, Bass.BASS_ChannelSeconds2Bytes(handle, value / 1000d));
}
}
static string mp3 = "going brown again.mp3";
static double tick = 631.578947368421;
static int handle = 0;
static void Main(string[] args)
{
bool exit = true;
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
handle = Bass.BASS_StreamCreateFile(mp3, 0L, 0, BASSFlag.BASS_DEFAULT);
Bass.BASS_ChannelPlay(handle, true);
new Thread(new ThreadStart(report)).Start();
while (exit)
{
ConsoleKeyInfo k = Console.ReadKey();
switch (k.Key)
{
case ConsoleKey.UpArrow:
position += tick;
break;
case ConsoleKey.DownArrow:
position -= tick;
break;
case ConsoleKey.X:
Environment.Exit(0);
break;
}
}
}
public static void report()
{
bool toOut = true;
while (true)
{
if (position % tick < 20 && toOut == true)
{
Console.WriteLine("tick " + position);
toOut = false;
}
if (position % tick > 20)
{
toOut = true;
}
Thread.Sleep(1);
}
}
}
http://www.mediafire.com/?oetvn5ksi4brjvi mp3 in question can be found here
any help on ways to fix this or whats wrong with the mp3 would be appreciated, thanks