从指定的时间C#播放MP3文件在指定的时间 [英] C# play MP3 file from specified time for the specified time

查看:313
本文介绍了从指定的时间C#播放MP3文件在指定的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个程序,您可以导入MP3文件进去,并告诉它发挥它起始于一个特定的位置,并为指定的时间播放量

I'm wanting to create a program that you can import an mp3 file into, and tell it to play it starting at a specific position, and to play for a specified amount of time.

我看着n音讯,并得到了它的播放和停止播放MP3文件,但我无法弄清楚如何在特定的位置开始。 ?任何人都知道我应该做的。

I've looked into NAudio, and got it to play and stop the mp3 file, but I can't figure out how to start at a specific position. Anybody know what I should do?

推荐答案

如果你使用n音讯,查找在输出流的Seek方法 - 从这个谷歌搜索返回的信息, http://www.google .COM /搜q =寻求+网站:naudio.codeplex.com ,应该让你开始

If you're using NAudio, look for a Seek method on the output stream -- the information returned from this Google search, http://www.google.com/search?q=seek+site:naudio.codeplex.com, should get you started.

您也可以使用一些旧的,但功能的Windows。的API如下所示(MCI的接口): HTTP ://forum.codecall.net/csharp-tutorials/20420-tutorial-playing-mp3-files-c.html 演示了如何从C#调用MCI。 MCI使用了一个非常简单的字符串接口,所以一旦你可以在所有调用它,它非常容易使用,它支持的任何命令,并支持寻求与求[文件]至[位置]命令,如下所示:< A HREF =http://www.codeproject.com/KB/audio-video/MP3Example.aspx相对=nofollow> http://www.codeproject.com/KB/audio-video/MP3Example.aspx

You could also use some old but functional Windows APIs (the MCI interface) as shown here: http://forum.codecall.net/csharp-tutorials/20420-tutorial-playing-mp3-files-c.html demonstrates how to call MCI from C#. MCI uses a very simple string interface, so once you can call it at all it's pretty easy to use any command it supports, and it supports seeking, with the "seek [file] to [position]" command, as shown here: http://www.codeproject.com/KB/audio-video/MP3Example.aspx.

这篇关于从指定的时间C#播放MP3文件在指定的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆