vb如何用api录音保存为wav?

hc2008l5 2016-06-20 01:05:32
vb如何用api录音保存为wav?
http://bbs.csdn.net/topics/10291998
...全文
2564 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
一般也只能保存为WAV,比较大,如果能压缩成MP3更好,体积能小几倍
hc2008l5 2016-06-25
  • 打赏
  • 举报
回复
http://blog.csdn.net/mengzhuanghua/article/details/5959688
赵4老师 2016-06-21
  • 打赏
  • 举报
回复
record The record command starts recording data. VCR and waveform-audio devices recognize this command. Although digital-video devices and MIDI sequencers also recognize this command, the MCIAVI and MCISEQ drivers do not implement it. wsprintf(lpstrCommand, "record %s %s %s", lpszDeviceID, lpszRecordFlags, lpszFlags); Parameters lpszDeviceID Identifier of an MCI device. This identifier or alias is assigned when the device is opened. lpszRecordFlags Flag for recording data. The following table lists device types that recognize the record command and the flags used by each type: digitalvideo at rectangle audio stream stream from position hold insert overwrite to position video stream stream sequencer from position insert overwrite to position vcr at time from position initialize insert overwrite to position waveaudio from position insert overwrite to position The following table lists the flags that can be specified in the lpszRecordFlags parameter and their meanings: at rectangle Specifies a rectangular region of the external input used as the source for the pixels compressed and saved. If not specified, the rectangle defaults to the rectangle specified for put "video". When it is set differently from the "video" rectangle, the displayed image is not what is recorded. at time Indicates when the device should begin performing this command, or, if the device has been cued, when the cued command begins. For more information, see the cue command. audio stream stream Specifies the audio stream used for recording. If this flag is not specified and the file format does not define a default, it is recorded into the stream that is physically first. from position Specifies a starting position for the recording. If the "from" flag is not specified, the device starts recording at the current position. hold Freezes the image when recording has finished instead of showing live video. When recording stops, an automatic monitor "file" command is performed. To return to live video, issue the monitor "input" command. initialize Initialize the tape (media), which involves recording timecode (if possible) for blank video and audio. This command might take several hours if the entire tape must be initialized. insert Specifies that new data is added to the file at the current position. overwrite Specifies that new data will replace data in the file. to position Specifies an ending position for the recording. If the "to" flag is not specified, the device records until it receives a stop or pause command. video stream stream Specifies the video stream used for recording. If this is not specified and the file format does not define a default, then it is recorded into the stream that is physically first. lpszFlags Can be "wait", "notify", or both. For digital-video and VCR devices, "test" can also be specified. For more information about these flags, see The Wait, Notify, and Test Flags. Return Values Returns zero if successful or an error otherwise. Remarks The recording stops when a stop or pause command is issued. For the MCIWAVE driver, all data recorded after a file is opened is discarded if the file is closed without saving it. Before issuing any commands that use position values, you should set the desired time format by using the set command. The tracks to be recorded are specified by the settimecode "record", set "assemble record", setvideo "record", and setaudio "record" commands. The following command starts recording at the current position: record mysound QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Unsupported. See Also MCI Overview, MCI Command Strings, cue, monitor, pause, put, set, setaudio, settimecode, setvideo, stop
赵4老师 2016-06-21
  • 打赏
  • 举报
回复
示例(Multimedia MCI 控件)
Visual Basic 示例

下面的示例演示了打开一台使用兼容数据文件的 MCI 设备的过程。将这些代码放到 Form_Load 过程,应用程序就可以使用 Multimedia MCI 控件来对文件 Gong.wav 进行 播放、记录和倒带。在试运行这个示例之前,首先应创建一个包含 Multimedia MCI 控件的窗体。

Private Sub Form_Load () 
' Set properties needed by MCI to open.
MMControl1.Notify = FALSE
MMControl1.Wait = TRUE
MMControl1.Shareable = FALSE
MMControl1.DeviceType = "WaveAudio"
MMControl1.FileName = "C:\WINDOWS\MMDATA\GONG.WAV"

'打开 MCI WaveAudio 设备。
MMControl1.Command = "Open"
End Sub


为了正确管理多媒体资源,在退出应用程序之前,应该关闭那些已经打开的 MCI 设备。将下面的语句放到 Form_Unload 过程,那么在退出包含 Multimedia MCI 控件的窗体之前,就可以关闭那些已经打开的 MCI 设备。

Private Sub Form_Unload (Cancel As Integer)
MMControl1.Command = "Close"
End Sub

hc2008l5 2016-06-20
  • 打赏
  • 举报
回复
http://blog.csdn.net/tanaya/article/details/33109
hc2008l5 2016-06-20
  • 打赏
  • 举报
回复
http://bbs.csdn.net/topics/50015346
1,create.ZIP 不用OCX来创建自己的控件(4KB)2,rganimate.ZIP 动画控件(35KB)3,rgassistant.ZIP 允许你创建一个Microsoft Office97那样的助手!(65KB)4,rgsysmoncal.ZIP 日期控件(35KB)5,datadrn.ZIP 创建数据驱动窗体(7KB)6,tooltip.zip 利用VB建立ToolTip窗口(4KB)7,trans.zip 建立透明的窗口(2KB)8,Anicur.zip 在窗口中建立动画光标(2KB)9,toolbar.zip 建立浮动工具栏的例程(22KB)10,winrgn.zip 建立不规则的窗口(2KB)11,winhole.zip 建立一个中间有洞的窗口(2KB) 12,split.zip 分割窗口并动态调整分割区域(类似于Windows中的资源管理器)(18KB)13,rubrect.zip 在屏幕上出现抓取窗口(8KB)14,hidebtn.zip 隐藏Win9X中任务栏上的“开始”按钮(2KB)15,console.zip 利用API函数建立控制台窗口(4KB)16,startinm.zip 将一个程序的窗口作为你的窗口的MDI子窗口(3KB)17,desktop.zip 一个可以动态排列桌面图标和动态改变屏幕分辨率的程序(29KB)18,rgdock.zip 建立类似Office工具栏的Docking Window(56KB)19,comboex.zip 一个非常cool的范例,可以在窗口中建立一个类似于Windows Explore的地址栏中的图标下拉ComboBox。其中还包含了其它的许多技巧(32KB)20,dyncontrol.zip 动态建立控件的范例(3KB)21,listitemdrag.zip 演示如何将列表框中的条目拖放到另外一个列表框中(2KB)22,ownerdrawmenu.zip 演示建立图形菜单,同一般的图形菜单不同,通过该程序建立的菜单当光标移动到菜单项上时,该项一样可以象Word97菜单项一样突出显示(11KB)23,traybar.zip 一个可以隐藏任务栏(Traybar)上的开始按钮、Switch Bar、快速启动按钮、任务栏图标、桌面图标的程序(3KB)24,windowsplacement.zip 更改Windows程序在Switch bar上的位置(3KB)25,tooltips.zip 利用Windows API实现的可显示多行文字的ToolTip(5KB)26,deskicon.zip 当你设置Windows的桌面墙纸之后,是否觉得桌面图标文字下的色块十分碍眼呢,这个程序可以使图标文字透明的显示在桌面上。还可以改变桌面图标文字的颜色以及图标文字下色快的颜色(2KB)27,animatedtitlebar.zip 这个程序可以使你的窗口的Title Bar动起来。很有趣的(26KB)28,resizr.zip 一个带源码以及演示的Resizer控件,就象Windows资源管理器的文件夹列表同文件列表之间的Resizer棒一样(7KB)29,taskbar.zip 一个带源码以及演示的TaskBar控件,可以让你的窗口象Windows的TaskBar一样(6KB)30,xeditor.zip 一个利用VB编写的功能比较完备的文本编辑器(172KB)31,custominputbox.zip 这个程序演示如何改变缺省的InputBox的外貌(10KB)32,controlpopmenu.zip 这个程序演示如何控制控件的缺省弹出菜单(例如TextBox),是完全控制而不只是隐藏和显示(3KB)33,coolmenu.zip 一个很Cool的菜单程序,可以把你的菜单改造成象Office系列的带图标的菜单(33KB)34,covereffect.zip 一个实现程

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧