[UWP] - MediaComposition音频效果在给定的Timespan和

人气:502 发布:2022-09-22 标签: wpdevelop

问题描述

你好,

我想问一下是否有办法在a的backgroundtrack上产生音频效果MediaComposition在给定时间和给定时间。

用法: 我想限制背景音轨的音量视频在合成中播放。

我在此处了解此示例: https://docs.microsoft。 com / en-us / windows / uwp / audio-video-camera / custom-audio-effects

测试它也让它工作,但我没有任何线索如何使用limitEffect和给定时间。

祝你好运,

Andy

解决方案

安迪,

在&absp; 自定义音频效果,在最后一部分,它介绍了一个wa y到 将自定义效果添加到MediaComposition 中的剪辑。它需要设置一个StartTimeInComposition和一个EndTimeInComposition属性。因此,我建议您创建一个 MediaComposition 对象,添加 MediaClip 对象(从音频创建)到MediaComposition。然后将自定义音频效果添加到剪辑。您可以在此处获得有关如何创建MediaComposition对象或MediaClip对象的更多信息:媒体作曲和编辑。

祝你好运,

Roy

Hello there,

I wanted to ask if there's a way to have an audioeffect on the backgroundtrack of a MediaComposition at a given time and for a given time.

Usage: I want to limit the background track's volume when videos are played in the composition.

I'm aware of this sample here: https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/custom-audio-effects

Tested it also and got it working, but I don't have any clue how to do that with the limitEffect and to a given time.

Best regards,

Andy

解决方案

Hi andy,

At the document forCustom audio effects, at the last part, it introduces a way to add your custom effect to a clip in a MediaComposition. It needs to set aStartTimeInComposition and aEndTimeInComposition property. So I suggest that you might create aMediaComposition object, add aMediaClip object (created from the audio) to the MediaComposition. Then add your custom audio effects to the clip. You could get more information about how to create a MediaComposition object or a MediaClip object here:Media compositions and editing.

Best regards,

Roy

943