Imports System.Runtime.InteropServices
Imports System.Text
Public Class Form1
<DllImport("winmm.dll", CharSet:=CharSet.Ansi, EntryPoint:="mciSendString")>
Shared Function mciSendString(ByVal lpstrCommand As String, ByRef lpstrReturnString As StringBuilder, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
End Function
<DllImport("winmm.dll", CharSet:=CharSet.Ansi, EntryPoint:="mciGetErrorString")>
Shared Function mciGetErrorString(ByVal dwError As Integer, ByRef lpstrBuffer As StringBuilder, ByVal uLength As Integer) As Integer
End Function
Dim ReturnString As New StringBuilder(256)
Dim RetValue As Integer
Dim errorstring As New StringBuilder(1024)
Private Sub Form_Unload(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
mciSendString("close all", ReturnString, 256, 0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'成不同的文件名,例如基于当前时间
Dim fileName As String = "Sound_" & DateTime.Now.ToString("yyyyMMddHHmmss") & ".Wav"
RetValue = mciSendString("stop sounds1", ReturnString, 256, 0)
RetValue = mciSendString("save sounds1 " & fileName, ReturnString, 256, 0)
If RetValue = 0 Then
Else
…
…
…
🎉精彩不容错过!新文章震撼登场,却因代码不全让人意犹未尽?别担心!我们为你准备了软件截图,让你先睹为快,感受其强大魅力。
✨如果你渴望解锁全部精彩内容,那么强烈建议你下载完整源代码。它将为你打开一扇通往编程新世界的大门,让你深入探索其中的奥秘,挖掘无限潜力。
🔗源代码下载网址:[https://download.csdn.net/download/qq_32257509/89624731]。赶紧行动起来,下载完整源代码,开启你的编程之旅吧!