VlcSharp : render tracker music internally to memorystream, than play

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Gerhard
New Cone
New Cone
Posts: 2
Joined: 22 Sep 2019 00:50

VlcSharp : render tracker music internally to memorystream, than play

Postby Gerhard » 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:

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();
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

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: VlcSharp : render tracker music internally to memorystream, than play

Postby mfkl » 09 Jan 2020 09:56

I'm not sure what you're trying to achieve exactly, but maybe this API is what you're looking for https://code.videolan.org/videolan/LibVLCSharp/blob/3.x/LibVLCSharp/Shared/MediaPlayer.cs#L1013?
https://mfkl.github.io


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 3 guests