What you are trying to do is very operating system dependent. You would need to write a program that creates a fake audio output device that the operating system could send the sounds to. Instead of playing the audio you would capture the audio stream once the user hits "record" and stop capturing when the user hits "stop". Then you would need to encode the captured audio data into the desired sound file format (wav, mp3, etc.).
It is possible to do what you are asking, but it is a non-trivial task since you are interfacing with the operating system's audio hardware abstraction layer and encoding audio.
如果您要使用 C#,请为您指明正确的方向。 .NET 框架不支持执行此操作,但是您可以从 .NET 访问 Windows API。一个好的起点是 http://www.pinvoke.net。 您还可以找到用 C# 编写的每个 API 的代码。我不知道您应该使用哪个 API 调用,但如果有的话,它会在 Win32 API 中退出。我知道有一种软件可以满足您尝试完成的任务。该软件的名称是 Spotify Ripper。如果您使用 API 间谍软件,您也许能够看到该软件正在使用哪些 API 调用!
To point you to right direction if you are going to use C#. There is no support for doing this in .NET framework, however you can access Windows API from .NET. A good start point is http://www.pinvoke.net. You’ll also find the code for each API write in C#. I have no clue which API calls you should use, but if there is any then it exit in Win32 API. I know of a software that dose what you try accomplish. The name of the software is Spotify Ripper. If you use an API spy software you may be able to see which API calls this software is using!
发布评论
评论(2)
您想要做的事情非常依赖于操作系统。您需要编写一个程序来创建一个假音频输出设备,操作系统可以将声音发送到该设备。您将在用户点击“录制”时捕获音频流,并在用户点击“停止”时停止捕获,而不是播放音频。然后,您需要将捕获的音频数据编码为所需的声音文件格式(wav、mp3 等)。
可以执行您所要求的操作,但这是一项不平凡的任务,因为您正在与操作系统的音频硬件抽象层进行交互并对音频进行编码。
What you are trying to do is very operating system dependent. You would need to write a program that creates a fake audio output device that the operating system could send the sounds to. Instead of playing the audio you would capture the audio stream once the user hits "record" and stop capturing when the user hits "stop". Then you would need to encode the captured audio data into the desired sound file format (wav, mp3, etc.).
It is possible to do what you are asking, but it is a non-trivial task since you are interfacing with the operating system's audio hardware abstraction layer and encoding audio.
如果您要使用 C#,请为您指明正确的方向。
.NET 框架不支持执行此操作,但是您可以从 .NET 访问 Windows API。一个好的起点是 http://www.pinvoke.net。
您还可以找到用 C# 编写的每个 API 的代码。我不知道您应该使用哪个 API 调用,但如果有的话,它会在 Win32 API 中退出。我知道有一种软件可以满足您尝试完成的任务。该软件的名称是 Spotify Ripper。如果您使用 API 间谍软件,您也许能够看到该软件正在使用哪些 API 调用!
To point you to right direction if you are going to use C#.
There is no support for doing this in .NET framework, however you can access Windows API from .NET. A good start point is http://www.pinvoke.net.
You’ll also find the code for each API write in C#. I have no clue which API calls you should use, but if there is any then it exit in Win32 API. I know of a software that dose what you try accomplish. The name of the software is Spotify Ripper. If you use an API spy software you may be able to see which API calls this software is using!