如何录制wave或wma文件 [英] How to record a wave or wma file

查看:145
本文介绍了如何录制wave或wma文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hellow

i我正在尝试用c#编写一个程序来录制任何扩展名为mp3,wma,wav等的声音文件

在网上搜索alaways找到用c ++或mfc编写的代码。那是为95号窗口写的,我想知道是否可以在windows Media Player上录制一个声音文件,如果有的话请帮我提一下这个代码的提示或链接,如果不是直接指示我的任何短片代码(在c#中)

hellow
i am trying to write a program in c# to record a sound file of any extension mp3,wma,wav...etc
searching in the net i alaways find codes written in c++ or mfc. that was written for window 95 ,i wonder if
windows Media Player can record a sound file,if so please help me with a hint or a link to that code, if not kindly direct me to any short codes (in c#)

推荐答案

不,音频文件格式和压缩算法不是由文件名extensions定义的。有不同的编解码器,流,它们托管在不同容器格式的文件中;这件事可以结合起来。要了解相关信息,请参阅: http://en.wikipedia.org/wiki/Digital_container_format [ ^ ]。



对于录音,有限但最简单的方式,你可以看到我的文章实用录音机声音激活 [ ^ ]。



产生.wav格式。然后你可以重新掌握它到任何其他,* .mp3或* .wma。我建议你使用可用的库甚至命令行实用程序,开源libav或FFMpeg。请查看我过去的答案:

如何使用Directshow修剪视频!? [ ^ ],

如何在C#中将图像转换为视频 [ ^ ],

HTML5和Mime,直播视频? [ ^ ]。



你可以做更多复杂的事情,自己数字化声音,动态压缩,以及更多。请记住,这是非常复杂的事情(不是原则,而是由于大量的知识和各种所需的标准和选项),并且意味着大量的工作。



-SA
No, audio file formats and compression algorithms are not defined by the file name "extensions". There are different codecs, streams, and they are hosted in a file of different container formats; this things can combine. To get an idea, please read: http://en.wikipedia.org/wiki/Digital_container_format[^].

For sound recording, limited but simplest way, you can see my article Practical Sound Recorder with Sound Activation[^].

That produces .wav format. Then you can re-master it to any other, *.mp3 or *.wma. I would recommend you to use available library or even command-line utility, open-source libav or FFMpeg. Please see my past answers:
How to trim the video using Directshow!?[^],
how to convert image to video in C#[^],
HTML5 and Mime, Streaming a video?[^].

You could do a lot more sophisticated things, digitize sound by yourself, do the compression on the fly, and a lot more. Just remember that it is quite complicated matter (not by principles but rather due to a big volume of knowledge and variety of required standards and options) and would mean a huge amount of work.

—SA


这篇关于如何录制wave或wma文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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