Hi @Shakir Ahmed ,
Welcome to Microsoft Q&A!
It is recommended that you refer to the Custom audio effects, use a Windows Runtime component to host your audio effect class.
After creating the WinRT component according to the documentation, use MediaPlayer.AddAudioEffect
to add the audio effect.
This simple example will mix the current audio sample with a value from the delay buffer according the value of the Mix property.
// Create a property set and add a property/value pair
PropertySet echoProperties = new PropertySet();
echoProperties.Add("Mix", 0.5f);
// Instantiate the custom effect defined in the 'AudioEffectComponent' project
AudioEffectDefinition echoEffectDefinition = new AudioEffectDefinition(typeof(ExampleAudioEffect).FullName, echoProperties);
mediaPlayerElement.MediaPlayer.AddAudioEffect(echoEffectDefinition.ActivatableClassId, true, echoProperties);
Here I use MediaPlayerElement
to use MediaPlayer
.
<Grid>
<MediaPlayerElement x:Name="mediaPlayerElement" Source="ms-appx:///Assets/sample.mp4" AutoPlay="True" />
</Grid>
Thank you
Junjie
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.