在WPF声音可视化库中显示soveFormTimeline控制

发布于 2025-02-08 15:15:45 字数 932 浏览 3 评论 0原文

我的问题很简单。我想通过声音可视化库的waveformtimeline控件导入一个音频文件,并导入后,显示音频的波形。

string[] files = open.FileNames;

foreach (string file in files)
{
    wave = new NAudio.Wave.WaveFileReader(file);
    output = new NAudio.Wave.DirectSoundOut();
    output.Init(new NAudio.Wave.WaveChannel32(wave));
    output.Pause();
                                                                                           
    WaveformPlot.BeginInit();
    WaveformPlot = new WaveformTimeline();
    WaveformPlot.RegisterSoundPlayer();
}

我几乎在那儿,但是我不知道该传递registersoundplayer()方法。我已经在图书馆的文档及其代码中查看。我知道它需要以某种方式的实例,如这个问题,但是此后名称似乎已经更改。 有什么想法吗?

My problem is simple. I want to import an audio file, and once imported, display a waveform of the audio using the Sound Visualization Library's WaveformTimeline Control.

string[] files = open.FileNames;

foreach (string file in files)
{
    wave = new NAudio.Wave.WaveFileReader(file);
    output = new NAudio.Wave.DirectSoundOut();
    output.Init(new NAudio.Wave.WaveChannel32(wave));
    output.Pause();
                                                                                           
    WaveformPlot.BeginInit();
    WaveformPlot = new WaveformTimeline();
    WaveformPlot.RegisterSoundPlayer();
}

I am almost there, but I can't figure out what to pass the RegisterSoundPlayer() method. I have looked in the library's documentation and in its code. I know it needs an instance of the player somehow, as shown in this question, but the names seem to have been changed since then.
Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

2025-02-15 15:15:45

也许您需要 jacobjohnston/wpfsvl

WPF声音可视化库是WPF控件的集合,用于以图形方式显示与声音处理相关的数据。当前的控件包括频谱分析仪,波形时间轴和专辑art展示面板。
WPF声音可视化库控件的大多数都是为了为我的另一个项目BPMinus提供动力。检查一下。

Maybe you need jacobjohnston/wpfsvl

The WPF Sound Visualization Library is a collection of WPF Controls for graphically displaying data related to sound processing. Current controls include a Spectrum Analyzer, Waveform Timeline, and an Album Art Display Panel.
Most of the WPF Sound Visualization Library controls were created to power my other project, BPMinus. Check it out.

雨巷深深 2025-02-15 15:15:45

在您的mainwindow.xaml文件中添加;

 xmlns:xmlns:svl="clr-namespace:WPFSoundVisualizationLib;assembly=WPFSoundVisualizationLib"

在位置,您要添加要使用的控件;

<svl:WaveformTimeline x:name="svlWaveform" />

在后面的代码中,初始化它很简单;

NAudioEngine soundEngine = NAudioEngine.Instance;
svlWaveform.RegisterSoundPlayer(soundEngine);

In your mainwindow.xaml file add;

 xmlns:xmlns:svl="clr-namespace:WPFSoundVisualizationLib;assembly=WPFSoundVisualizationLib"

and in the location you want to add the control you would use;

<svl:WaveformTimeline x:name="svlWaveform" />

in your code behind to initialize it is as simple as;

NAudioEngine soundEngine = NAudioEngine.Instance;
svlWaveform.RegisterSoundPlayer(soundEngine);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文