VlcSharp : render tracker music internally to memorystream, than play
Posted: 22 Sep 2019 01:12
I'd like to do the following:
* Load a tracker-module file (FastTracker, ImpulseTracker, et cetera)
* Parse the file to a memorystream (wav?)
* Play that memorystream
I can play a tracker-module file fine, using code such as:
However, i'd like to skip to certain parts in the music using a trackbar (WinForms).
This is working, but due to the nature of Tracker Modules, I might not hear all samples that should be playing at a certain offset. For example, a looped string might start at the beginning of a track (first pattern) and continue for 30 seconds of the song. If I skip to say 10 seconds, I (might not) hear that string playing.
So, as a solution I'd like to parse the whole track to memory first, than play the memorystream instead.
I know that I could export to disk, (with AddOption and "sout:...") than open that file and play it, but I'd rather play a direct stream instead (less overhead).
I can't figure out the code I need to write to do this? There are some code samples, but I couldn't find a solution, and there is little documentation available. Any help would be appreciated
* Load a tracker-module file (FastTracker, ImpulseTracker, et cetera)
* Parse the file to a memorystream (wav?)
* Play that memorystream
I can play a tracker-module file fine, using code such as:
Code: Select all
Core.Initialize();
_libVLC = new LibVLC();
_mediaPlayer = new MediaPlayer(_libVLC);
var media = new Media(_libVLC, "c:\\modulefile.xm", FromType.FromPath);
_mediaPlayer.Media = media;
_mediaPlayer.Play();
This is working, but due to the nature of Tracker Modules, I might not hear all samples that should be playing at a certain offset. For example, a looped string might start at the beginning of a track (first pattern) and continue for 30 seconds of the song. If I skip to say 10 seconds, I (might not) hear that string playing.
So, as a solution I'd like to parse the whole track to memory first, than play the memorystream instead.
I know that I could export to disk, (with AddOption and "sout:...") than open that file and play it, but I'd rather play a direct stream instead (less overhead).
I can't figure out the code I need to write to do this? There are some code samples, but I couldn't find a solution, and there is little documentation available. Any help would be appreciated