如何使用C#合并/加入MP3文件?(How do I merge/join MP3 files with C#?)

编程入门 行业动态 更新时间:2024-10-14 14:19:57
如何使用C#合并/加入MP3文件?(How do I merge/join MP3 files with C#?)

我有一个不同单词/短语的库,为了在目前建立句子,我将这些短语的组合添加到播放列表中以制作句子。 不幸的是,如果用户正在运行CPU密集型应用程序(我的大多数用户都是),那么句子中间可能会有几秒钟的延迟(在短语之间)。

为了解决这个问题,我想到了一种方法,它会将正确的MP3文件组合合并到一个合适的短语中,将其保存在%temp%目录中,然后播放这个应该克服问题的1个MP3文件我我遇到了差距。

在C#中最简单的方法是什么? 是否有捷径可寻? 文件相当小,每个文件长3-4秒,一个句子可以包含3-20个短语。

I have a library of different words/phrases, and in order to build sentences at present I add a combination of these phrases into a playlist to make a sentence. Unfortunately if the user is running CPU intensive applications (which most of my users are) there can be a lag of a few seconds mid-sentence (in between phrases).

In order to combat this I was thinking of an approach which will merge the right combination of MP3 files on the fly into an appropriate phrase, save this in the %temp% directory, and then play this 1 MP3 file which should overcome the problem I'm experiencing with gaps.

What is the easiest way to do this in C#? Is there an easy way to do this? The files are fairly small, 3-4 seconds long each, and a sentence can consist of 3-20ish phrases.

最满意答案

MP3文件由“帧”组成,每个帧代表一个简短的片段(我认为大约25毫秒)的音频。

所以是的,你可以毫无问题地连接它们。

MP3 files consist of "frames", that each represent a short snippet (I think around 25 ms) of audio.

So yes, you can just concatenate them without a problem.

更多推荐

本文发布于:2023-07-27 20:21:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1295003.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文件   files   merge   join

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!