在WinForms应用程序中拆分wmv / wav文件

时间:2021-01-13 19:41:07

I have a Windows Forms application, and I use an instance of Windows Media Player (via WMPLib) to play some audio/video files, either wmv or wav format. What I currently need to do is split the original file and "extract" one ore more clips from it, let's say 3-4 seconds from a specific point in time of the file.

我有一个Windows窗体应用程序,我使用Windows Media Player实例(通过WMPLib)播放一些音频/视频文件,wmv或wav格式。我目前需要做的是拆分原始文件并从中提取一个或多个剪辑,比如文件的特定时间点3-4秒。

Any ideas how to do this?

任何想法如何做到这一点?

Third party libraries are ok, as long as they are not all that expensive

第三方库是可以的,只要它们不是那么昂贵

2 个解决方案

#1


Have a look at the Windows Media Encoder SDK. Something like this:

看看Windows Media Encoder SDK。像这样的东西:

Int32 StartTime = 60 * 1000;Int32 EndTime = 120 * 1000;String SourceName = "original.mp3";String DestinationName = "split.mp3";WMEncBasicEdit SplitFile = new WMEncBasicEdit();SplitFile.MediaFile = SourceName;SplitFile.OutputFile = DestinationName;SplitFile.MarkIn = StartTime;SplitFile.MarkOut = EndTime;SplitFile.Start();

should work.

#2


Or use ffmpeg

或者使用ffmpeg

#1


Have a look at the Windows Media Encoder SDK. Something like this:

看看Windows Media Encoder SDK。像这样的东西:

Int32 StartTime = 60 * 1000;Int32 EndTime = 120 * 1000;String SourceName = "original.mp3";String DestinationName = "split.mp3";WMEncBasicEdit SplitFile = new WMEncBasicEdit();SplitFile.MediaFile = SourceName;SplitFile.OutputFile = DestinationName;SplitFile.MarkIn = StartTime;SplitFile.MarkOut = EndTime;SplitFile.Start();

should work.

#2


Or use ffmpeg

或者使用ffmpeg