我有一个不同单词/短语的库,为了在目前建立句子,我将这些短语的组合添加到播放列表中以制作句子。 不幸的是,如果用户正在运行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.
更多推荐
发布评论