Home > Forum > Mediaplayer SDK, Avalonia - Unable to play Karaoke CDG & zip files

Mediaplayer SDK, Avalonia - Unable to play Karaoke CDG & zip files

Jan 21 (20 days ago)
Alan Wood wrote
HI,
I’m currently using the demo version of your Media player SDK to evaluate it, to see if meets my needs for a new project that I’m currently working on, I’m using your simple Mediaplayer demo for my evaluation, however.. as well as audio and video playback, I also need Karaoke CDG and zip file playback, all with pitch shifting.

I cannot find any demos of Karaoke media playback for Avalonia, but from reading the documentation it appears that I need to do the following for Zipped files:

_currentSettings = new CDGSourceSettings(zipFile);
_currentSettings.EnablePitchShifting = true;
_currentSettings.PitchSemitones = tbPitch.Value;
await _player.OpenAsync(_currentSettings);

And the following for MP3+G:
_currentSettings = new CDGSourceSettings(cdgFile, audioFile);
_currentSettings.EnablePitchShifting = true;
_currentSettings.PitchSemitones = tbKey.Value;
await _player.OpenAsync(_currentSettings);

However I get the following errors in the Debug:

[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'OverlayManager' to pipeline.
[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected Queue.[QueueBlock] Out Auto to OverlayManager.[OverlayManagerBlock] In Video
[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'VideoEffects' to pipeline.
[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected OverlayManager.[OverlayManagerBlock] Out Video to VideoEffects.[VideoEffectsBlock] In Video
[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'VideoRenderer' to pipeline.
[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected VideoEffects.[VideoEffectsBlock] Out Video to VideoRenderer.[VideoRendererBlock] In Video
[12:44:31 INF] [MediaPlayerCoreX][Play] Using async API.
[12:44:31 DBG] [MediaBlocksPipeline[MediaPlayerCoreX]][CreatePipeline] Building 8 media blocks...
[12:44:31 ERR] [CDGSource][Init] Unable to create cdgparse.
[12:44:31 ERR] [CDGSourceBlock][Build] Unable to build CDGSourceBlock.
[12:44:31 ERR] [MediaBlocksPipeline[MediaPlayerCoreX]][CreatePipeline] Failed to build block 'CDGSource'.
[12:44:31 ERR] [MediaBlocksPipeline[MediaPlayerCoreX]][Open] Unable to create some pipeline elements.

Any help with resolving the issue would be appreciated, I know its almost certainly something I’m doing wrong!!
I’m currently working on a Linux Cinnamon (Mint 22) machine, however I’ve also tried building the project on Windows 11 with the same results.

Thanks

Alan
Reply
14 Answers
Jan 21 (20 days ago)
Roman Miniailov agent wrote
Hi

Add NuGet package

<PackageReference Include="VisioForge.CrossPlatform.Core.Windows.Adds.x64" Version="2025.11.0" />

Or check this sample - https://github.com/visioforge/.Net-SDK-s-samples/tree/master/Media%20Player%20SDK%20X/WinForms/Karaoke%20Demo

Do you have this issue in some other sample?
Jan 21 (20 days ago)
Alan Wood wrote
thanks, I'll add the package and give it a try.

I've looked at that sample, It appears to be for winforms, I'm using Avalonia?
Jan 21 (20 days ago)
Alan Wood wrote
Just added the package, restarted the project and I'm still getting the same errors.
Jan 21 (20 days ago)
Roman Miniailov agent wrote
Let me create an Avalonia sample.

Do you have this issue in WinForms app?
Jan 21 (20 days ago)
Alan Wood wrote
No, the WinForms Karaoke demo worked without issue.
Jan 22 (19 days ago)
Alan Wood wrote
Hi Roman,
Thanks for the demo, It works fine in Windows, however it cannot play Karaoke files running on Linux. I've yet to try it on macOs yet as I haven't had time.

I get the following debug data when trying to play the files:

[MediaBlocksPipeline[MediaPlayerCoreX]][DisposeAsync] Starting async disposal...
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Pipeline graph saved to pipeline_dispose_20260122_122312.dot
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Starting managed resource cleanup...
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Video view cleared.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Media blocks cleaned up and collections cleared.
[12:23:12 INF] [SafeElementLinker][CleanupManagedCapsFilters] Cleaned up 0 managed capsfilters
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] SafeElementLinker capsfilters cleaned up.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Pipeline NULL state achieved: Null
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Bus disposed after pipeline NULL state.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Pipeline context disposed.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Callback delegates cleared.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Event handlers cleared.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Managed resource cleanup completed.
[MediaBlocksPipeline[MediaPlayerCoreX]][Dispose] Dispose completed successfully.
[MediaBlocksPipeline[MediaPlayerCoreX]][DisposeAsync] Async disposal completed.
[12:23:12 INF] [MediaPlayerCoreX][CreatePipeline] CreatePipeline
[MediaBlocksPipeline[MediaPlayerCoreX]][Constructor] Creating new MediaBlocksPipeline: MediaPlayerCoreX
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'Queue' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'CDGSource' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected CDGSource.[CDGSourceBlock] Out Audio to Queue.[QueueBlock] In Auto
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'AudioEffects' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected Queue.[QueueBlock] Out Auto to AudioEffects.[AudioEffectsBlock] In Audio
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'AudioRenderer' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected AudioEffects.[AudioEffectsBlock] Out Audio to AudioRenderer.[AudioRendererBlock] In Audio
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'Queue' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected CDGSource.[CDGSourceBlock] Out Video to Queue.[QueueBlock] In Auto
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'OverlayManager' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected Queue.[QueueBlock] Out Auto to OverlayManager.[OverlayManagerBlock] In Video
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'VideoEffects' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected OverlayManager.[OverlayManagerBlock] Out Video to VideoEffects.[VideoEffectsBlock] In Video
[MediaBlocksPipeline[MediaPlayerCoreX]][AddBlock] Successfully added block 'VideoRenderer' to pipeline.
[MediaBlocksPipeline[MediaPlayerCoreX]][Connect] Successfully connected VideoEffects.[VideoEffectsBlock] Out Video to VideoRenderer.[VideoRendererBlock] In Video
[12:23:12 INF] [MediaPlayerCoreX][Play] Using async API.
[MediaBlocksPipeline[MediaPlayerCoreX]][CreatePipeline] Building 8 media blocks...
[12:23:12 ERR] [CDGSource][Init] Unable to create cdgparse.
[12:23:12 ERR] [CDGSourceBlock][Build] Unable to build CDGSourceBlock.
[12:23:12 ERR] [MediaBlocksPipeline[MediaPlayerCoreX]][CreatePipeline] Failed to build block 'CDGSource'.
[12:23:12 ERR] [MediaBlocksPipeline[MediaPlayerCoreX]][Open] Unable to create some pipeline elements.

Alan
Jan 22 (19 days ago)
Roman Miniailov agent wrote
I have updated macOS version on GitHub, we forgot to add <PackageReference Include="VisioForge.CrossPlatform.Core.macOS.Adds" Version="2025.9.1" /> package.

About Linux - please tell me GStreamer version and installed packages. Have you checked this guide - https://www.visioforge.com/help/docs/dotnet/deployment-x/Ubuntu/ ?
Jan 22 (19 days ago)
Alan Wood wrote
I've read and installed everything from the guide before I started...

The "gst-inspect-1.0 --version" command returns:
gst-inspect-1.0 version 1.24.2
GStreamer 1.24.2


attached is a screen grab of the installed packages.
Jan 22 (19 days ago)
Roman Miniailov agent wrote
Let me check. Maybe we need to add CDG parser additionally as a package.

Is it Ubuntu?
Jan 22 (19 days ago)
Alan Wood wrote
It's Mint 22, so yes.
Jan 23 (18 days ago)
Roman Miniailov agent wrote
I've added new NuGet package with required CDG plugin. The problem that v1.24 of GStreamer on Ubuntu/Mint is not fresh, and has no this plugin, like modern v1.26 of Gstreamer.

Please check update https://github.com/visioforge/.Net-SDK-s-samples/tree/master/Media%20Player%20SDK%20X/Avalonia/Karaoke%20Demo

You can also install modern 1.26 version of GStreamer, but probably it can be not easy.
Jan 23 (18 days ago)
Alan Wood wrote
Thank you, the update is working on Linux now.
today 11:41 (3 hours ago)
Alan Wood wrote
Hi Roman,
I have most of what I need working, however I cannot get the audio effects to work and I’ve tried on both Linux and Windows, for example following does nothing:

var effect = new KaraokeAudioEffect();
effect.FilterBand = 220;
effect.FilterWidth = 100;
_player.Audio_Effects_AddOrUpdate(effect);

Also I cannot get the pitch control working for (non-CDG) audio and video, however it works for .cdg files.
I’m using the following to set the pitch on audio & video files:

private PitchShiftAudioEffect _pitch;
.....
_pitch = new PitchShiftAudioEffect(0);

then

..... else if (_cdg == false)
{
var semitones = (int)tbPitch.Value;
_pitch.Pitch = semitones;
_player.Audio_Effects_AddOrUpdate(_pitch);
}

I’m probably doing something wrong and I have one other thing I’m probably going to need some assistance with, however one step at a time!!

Thanks again.

Alan