在WPF声音可视化库中显示soveFormTimeline控制
我的问题很简单。我想通过声音可视化库的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您需要 jacobjohnston/wpfsvl
Maybe you need jacobjohnston/wpfsvl
在您的mainwindow.xaml文件中添加;
在位置,您要添加要使用的控件;
在后面的代码中,初始化它很简单;
In your mainwindow.xaml file add;
and in the location you want to add the control you would use;
in your code behind to initialize it is as simple as;