Hi,
i am working on a project where i need to play an audiofile (mp3) and after a specific amount of time i need to trigger some kind of a signal. Therefore i wrote my own AudioFileReader.
KR Manuel
i am working on a project where i need to play an audiofile (mp3) and after a specific amount of time i need to trigger some kind of a signal. Therefore i wrote my own AudioFileReader.
public class TimeElapsedAudioFileReader : AudioFileReader
{
public event Action<TimeSpan> Elapsed;
public TimeElapsedAudioFileReader(string filename):base(filename)
{
}
public override int Read(byte[] buffer, int offset, int count)
{
if (Elapsed != null)
Elapsed(this.CurrentTime);
return base.Read(buffer, offset, count);
}
}
The Problem with that approach is that it is not precise enough. I wanna have the elapsed Signal triggered after each millisecond for example, therefore i thought i have to set the buffersize that is read but i cant find anything to set the buffersize. Maybe I am wrong with my thoughts? Hope for help!KR Manuel