wasapi

How to control the Microphone Boost in Windows 7?

孤街醉人 提交于 2019-12-13 16:42:11
问题 I am trying to control the Microphone Boost (level/(un)mute) in Windows 7 using the MIXER API in a C/C++ application, but I do not get the controls for the same. Can it be done using WASAPI? Can somebody suggest any other API to control the Microphone Boost in Windows 7? This is what I have written so far ... const IID IID_IDeviceTopology = __uuidof(IDeviceTopology); const IID IID_IPart = __uuidof(IPart); const IID IID_IAudioAutoGainControl = __uuidof(IAudioAutoGainControl); HRESULT hr = S_OK

WASAPI + windows store app initialization

大兔子大兔子 提交于 2019-12-13 02:32:52
问题 I am trying to write a program which captures your speech applies my effect on the captured audio and play it back immediately. I am writing this app to the windows store in c++. After suffering with MediaCapture I decided to use WASAPI to do that. I am using an example from the msdn to set up WASAPI. As I expected I ran into a problem very soon. So the problem is with the following two lines: const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); const IID IID

Set WMP volume level

孤者浪人 提交于 2019-12-12 03:59:18
问题 What i want to do is set the Windows Media Player's volume level. By default the volume is in-/decreased by 10% when e.g. clicking the down or up menu item (Play -> Volume -> Up), but this is, in my opinion, not fine enough (especially when e.g. skypeing with someone while listening to music). The media player should stay an independent application. Currently i'm using a little tool that sends app commands via SendMessage to the player with parameters as seen in spy++. I thought of three ways

Loopback is saved in buffer, how to write to disk as wav?

独自空忆成欢 提交于 2019-12-12 01:36:31
问题 In the code below, you can copy paste it to an empty proejct, add main.cpp and it is saving it to buffer, however I don't know how to write that buffer to file. You can see in SetFormat I set it up, and then in CopyData I am writing to the buffer. Complete C++ beginner here, I was able to mash this up. How can I write the buffer to file? #include <mmdeviceapi.h> #include <audioclient.h> #include "debug.h" #include <comdef.h> #define UNICODE //--------------------------------------------------

Resample loopback capture

梦想与她 提交于 2019-12-10 19:03:22
问题 I successfully captured sound from Wasapi using the following code: IWaveIn waveIn = new WasapiLoopbackCapture(); waveIn.DataAvailable += OnDataReceivedFromWaveOut; What I need to do now, is to resample the in-memory data to pcm with a sample rate of 8000 and 16 bits per sample mono. I can't use ACMStream to resample the example, because the recorded audio is 32 bits per second. I have tried this code to convert bytes from 32 to 16 bits, but all I get every time is just blank audio. byte[]

How do I get information out of IMMDevice?

匆匆过客 提交于 2019-12-10 10:14:02
问题 I'm a complete beginner with regards to IMMDevice, and I need to ask what a good, easy way to get some device out of information out of it is. In my program, I've already successfully set a pointer to one of those with GetDefaultAudioEndpoint(). Now I just need to be able to get some basic information out of it, like some speaker info or the ID of the speaker or anything like that. What's a good way to do this that a total beginner would be able to pick up on? Thanks! 回答1: Devices have

NAudio WasapiLoopbackCapture ComException (0x88890003)

ε祈祈猫儿з 提交于 2019-12-08 03:29:37
问题 I am trying to use the WasapiLoopbackCapture class (NAudio 1.7.1.17) and ending up with the COMException (0x88890003). The recording format is WaveFormat(44100, 16, 2) . I have multiple playback devices on my system and have tried setting each one as the default device with the same results. I have also verified that each of those devices has (44100, 16, 2) listed as a supported format. Console Output: WasapiCapture_RecordingStopped. Exception: System.Runtime.InteropServices.COMException

audio capture in metro apps

不打扰是莪最后的温柔 提交于 2019-12-07 08:47:36
问题 I need to perform low-level audio capture in my Windows 8 Metro-style app. I guess I need to use the IAudioClient interface, but how to get that interface? Microsoft says "A client obtains a reference to an IAudioClient interface for an audio endpoint device by using one of the techniques described in IMMDevice Interface.." http://msdn.microsoft.com/en-us/library/windows/desktop/dd370865(v=vs.85).aspx but IMMDevice interface is not supported for Metro-style apps. How does one get an

NAudio WasapiLoopbackCapture ComException (0x88890003)

佐手、 提交于 2019-12-06 14:56:43
I am trying to use the WasapiLoopbackCapture class (NAudio 1.7.1.17) and ending up with the COMException (0x88890003). The recording format is WaveFormat(44100, 16, 2) . I have multiple playback devices on my system and have tried setting each one as the default device with the same results. I have also verified that each of those devices has (44100, 16, 2) listed as a supported format. Console Output: WasapiCapture_RecordingStopped. Exception: System.Runtime.InteropServices.COMException (0x88890003): Exception from HRESULT: 0x88890003 at System.Runtime.InteropServices.Marshal

How to get Audio Formats supported by physical device (WinAPI, Windows)

懵懂的女人 提交于 2019-12-06 11:21:19
问题 I have an audio device (a USB microphone) and I want to find out what audio formats it supports natively (bit depth & sample rate), on OS X there is a nice kAudioStreamPropertyAvailablePhysicalFormats Core Audio property, but I fail to find something similar on Windows. I know there is this question Windows Core Audio Api get all supported formats on capture device but The answer is bad... and I'm not limited with windows Core Audio APIs, I need any way. Windows itself somehow knows it, so