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

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

Jan 21 (40 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
31 Answers
Jan 21 (40 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 (40 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 (40 days ago)
Alan Wood wrote
Just added the package, restarted the project and I'm still getting the same errors.
Jan 21 (40 days ago)
Roman Miniailov agent wrote
Let me create an Avalonia sample.

Do you have this issue in WinForms app?
Jan 21 (40 days ago)
Alan Wood wrote
No, the WinForms Karaoke demo worked without issue.
Jan 22 (39 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 (39 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 (39 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 (39 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 (39 days ago)
Alan Wood wrote
It's Mint 22, so yes.
Jan 23 (38 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 (38 days ago)
Alan Wood wrote
Thank you, the update is working on Linux now.
Feb 10 (20 days 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
Feb 11 (19 days ago)
Roman Miniailov agent wrote
We have fixed related issue in v2026.2.11. Please check it.
Feb 11 (19 days ago)
Alan Wood wrote
Thank you, I have checked.....
The Karaoke effect now works, however the pitch still isn't working for straight audio and video files.
Feb 11 (19 days ago)
Roman Miniailov agent wrote
Please show me full pitch code with parameters.
Feb 11 (19 days ago)
Alan Wood wrote

/// <summary>
/// The current CDG source settings.
/// </summary>
private CDGSourceSettings _currentSettings;

/// <summary>
/// Pitch shift for non-CDG Files
/// </summary>
private PitchShiftAudioEffect _pitch;


private async void MainWindow_Activated(object sender, EventArgs e)
{
.....
.....

/// <summary>
///create and initialize a new instance of _pitch
/// </summary>
_pitch = new PitchShiftAudioEffect(0);

.....
}


/// <summary>
/// Handles the pitch slider scroll.
/// </summary>
private void tbPitch_Scroll()
{
if (lbPitch == null || tbPitch == null || _player == null)
{
return;
}

var semitones = (int)tbPitch.Value;
lbPitch.Text = $"Pitch: {semitones:+#;-#;0}";

// Change pitch during playback
if (_currentSettings != null && _cdg == true)
{
_currentSettings.PitchSemitones = semitones;
}
else if (_cdg == false)
{
_pitch.Pitch = semitones;
_player.Audio_Effects_AddOrUpdate(_pitch);
}
}
Feb 11 (19 days ago)
Roman Miniailov agent wrote
Try this code, with correct pitch formula.

/// <summary>
/// Pitch shift for non-CDG Files
/// </summary>
private PitchAudioEffect _pitch; // Changed from PitchShiftAudioEffect to PitchAudioEffect

private async void MainWindow_Activated(object sender, EventArgs e)
{
// ... existing code ...

/// <summary>
/// Create and initialize a new instance of _pitch
/// Use PitchAudioEffect instead of PitchShiftAudioEffect for MediaPlayerCoreX
/// </summary>
_pitch = new PitchAudioEffect { Pitch = 1.0f }; // Start with no pitch change

// ... rest of code ...
}

/// <summary>
/// Handles the pitch slider scroll.
/// </summary>
private void tbPitch_Scroll()
{
if (lbPitch == null || tbPitch == null || _player == null)
{
return;
}

var semitones = (int)tbPitch.Value;
lbPitch.Text = $"Pitch: {semitones:+#;-#;0}";

// Change pitch during playback
if (_currentSettings != null && _cdg == true)
{
// CDG files - use CDGSourceSettings
_currentSettings.PitchSemitones = semitones;
}
else if (_cdg == false)
{
// Non-CDG files - convert semitones to pitch multiplier
// Formula: pitch = 2^(semitones/12)
var pitchMultiplier = (float)Math.Pow(2.0, semitones / 12.0);
_pitch.Pitch = pitchMultiplier;
_player.Audio_Effects_AddOrUpdate(_pitch);
}
}
Feb 11 (19 days ago)
Alan Wood wrote
Thank you, that works.

I have one final question....
Some CD+G audio file are multiplexed (dual mono), for example they will have music only on the left hand channel of the source track and Music plus vocals on the right, (the left and right may be the other way around), so my question is:

Is it possible to take either the left or right audio from the source and feed it to both left and right audio outputs?

Ideally it would be good to be able to pan from the left to the right of the source audio so the user can adjust the level of vocal in the mix, however if this is not possible switching between the source left, right and stereo would suffice.
Feb 11 (19 days ago)
Roman Miniailov agent wrote
I will add this feature today. Is it the last stop factor before a purchase? ;)
Feb 11 (19 days ago)
Alan Wood wrote
Thank you, It may be a week or two, but basically yes.... I'm working on a potential new product, It isn't actually a traditional Karaoke application, but needs to be able to play Karaoke files.
Feb 11 (19 days ago)
Alan Wood wrote
Roman, if you need a multiplexed MP3+G file let me know and I'll send you over one.

Regards

Alan.
Feb 11 (19 days ago)
Roman Miniailov agent wrote
Yes, please share test file with me. The task is simple, but I need to test it somehow.
Feb 11 (19 days ago)
Alan Wood wrote
see attached
Feb 11 (19 days ago)
Alan Wood wrote
The zip won't attach so I've emailed the file to you, if you don't get it (it may be to large for email) let me know and I'll put if on my ftp for you to download.
Feb 11 (19 days ago)
Roman Miniailov agent wrote
Please, update to v2026.2.12 and use new WeightedChannelMixAudioEffect effect. It has weights, so, you can tune more voice or more music.
Feb 12 (18 days ago)
Alan Wood wrote
Thank you, Tested... works very well.
Feb 13 (17 days ago)
Alan Wood wrote
Hi Roman,
Sorry to be a pain, I've just found an issue, the rate/speed control is only working with video files, It doesn't do anything with audio files (MP3 Flac etc.) and Karaoke files (MP3+G / Zip) it stops the audio playback. it works fine with video files (mp4 etc).
Currently I have only checked on Linux so don't know the situation with widows or Mac.

Using the code below, its straight from the media player demo:

private async void tbSpeed_Scroll()
{
if (_player == null)
{
return;
}

await _player.Rate_SetAsync(1 + (tbSpeed.Value / 100.0));
}
Feb 13 (17 days ago)
Roman Miniailov agent wrote
Good catch. Let me see.
Feb 15 (15 days ago)
Roman Miniailov agent wrote
Please check SDK update, an issue resolved. Lets close this thread, for more problems please create another one.