Questions tagged [wasapi]

The Windows Audio Session API (WASAPI) enables client applications to manage the flow of audio data between the application and an audio endpoint device.

The Windows Audio Session API (WASAPI) enables client applications to manage the flow of audio data between the application and an audio endpoint device.

For more details see msdn.microsoft.com.

234 questions
2
votes
2 answers

How to test for equality of audio sessions

I am trying to use the Windows Audio Session API to locate the default audio session within the enumeration of current audio sessions. Currently I have a reference to the IAudioSessionControl of the default session of the audio render endpoint in…
Joseph Trebbien
  • 309
  • 1
  • 3
  • 8
2
votes
1 answer

How to use IAudioClient3 (WASAPI) with Real-Time Work Queue API

I'm working on a lowest-possible latency MIDI synthetizer software. I'm aware of ASIO and other alternatives, but as they have apparently made significant improvements to the WASAPI stack (in shared mode, at least), I'm curious to try it out. I…
ehoopz
  • 139
  • 3
  • 10
2
votes
1 answer

What do the ERoles enumeration values in Windows Core Audio APIs represent? Are they mutually exclusive?

From the Microsoft API doc: https://learn.microsoft.com/en-us/windows/win32/api/mmdeviceapi/ne-mmdeviceapi-erole The ERole enum typedef enum __MIDL___MIDL_itf_mmdeviceapi_0000_0000_0002 { eConsole, eMultimedia, eCommunications, …
kakyo
  • 10,460
  • 14
  • 76
  • 140
2
votes
2 answers

Why do I get a "Invalid device" error when recording a device using WASAPI and the sounddevice library?

I am trying to write a script to record USB audio from a 4-channel audio device. I am using Python 3.7 and the "sounddevice" library. Upon being compiled the the code gives me an error. Using the following code, I found the device number of the…
PetSven
  • 366
  • 3
  • 13
2
votes
1 answer

Polling for audio sessions on default endpoint sometimes crashes on Win7

I'm working on an application which polls for the states and peak levels of audio sessions on the default audio rendering endpoint every X milliseconds, and implements some logic based on that. It seems to run fine on Windows 10, but on Windows 7 I…
Lurch
  • 63
  • 6
2
votes
1 answer

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

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…
dev_null
  • 1,907
  • 1
  • 16
  • 25
2
votes
2 answers

How to detect if another application's audio is playing in background? (UWP, Windows 10)

I am writing a C# SDK (to be used by UWP Publishers) and would like to detect if another application (Pandora, Spotify, Amazon Music, etc.) is playing music in the background, so that I can mute my SDK's sounds. This comment to this question seems…
Greg Thatcher
  • 1,303
  • 20
  • 29
2
votes
1 answer

Capture audio from WasapiLoopbackCapture, and convert to muLaw

I'm capturing audio with WasapiLoopbackCapture - format = IeeeFloat - SampleRate = 48000 - BitsPerSample = 32 I need to convert this to muLaw (8Khz, 8 bit, mono) - eventually it'll be sent to a phone via SIP trunking. I've tried 100s of…
KBoek
  • 5,794
  • 5
  • 32
  • 49
2
votes
0 answers

Playing audio through WASAPI - IAudioRenderClient and getting static

I'm trying to learn how to play audio through my default playback device using WASAPI. My test is capturing audio from my default device and sending it to the playback device to render so that I can hear myself talk through my speakers. It appears…
szMuzzyA
  • 136
  • 13
2
votes
1 answer

NAudio Wasapi recording and conversion

I'm using NAudio and trying to record what's being played on my pc with the WasapiLoopbackCapture. The problem that I have is that I need the recorded data as PCM 16bit 44100khz Mono. For that I have constructed this: using System; using…
hansOlaf
  • 23
  • 2
  • 5
2
votes
0 answers

IAudioClient::Initialize sometimes take several seconds to return

When I use the Windows WASAPI's function IAudioClient::Initialize to initialize a capture stream on an audio device, it sometimes takes several seconds to return successfully, although normally it only takes several hundred milliseconds. The code I…
StrongYao
  • 21
  • 2
2
votes
0 answers

rendering PCM audio bufferin C++ using Media Foundation/WASAPI for UWP

It's hard to find anything on the web reliable for audio rendering (there is capture, record and save to file, but rendering to speakers are rare using Media Foundation). The problem I have is that the tutorial of audio rendering provided by…
Tagh_azog
  • 21
  • 3
2
votes
2 answers

How to play raw pcm audio bytes on UWP apps?

I have a Universal Windows Platform (UWP) app where I want to play audio bytes that I recorded on a old Window phone 8.1 app. The audio is a array of bytes with raw PCM audio (mono, 16 bits, 16kHz). On my old Windows phone 8.1 app I just could use 3…
Toine db
  • 709
  • 7
  • 25
2
votes
1 answer

IAudioClient - get notified when playback ends?

I continuously send data to IAudioClient (GetBufferSize / GetCurrentPadding / GetBuffer / ReleaseBuffer), but I want to know when the audio device finishes playing the last data I sent. I do not want to assume the player stopped just because I sent…
Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
2
votes
2 answers

How do I convert signal in Universal Window Phone?

I use RTAudio to get a signal from Microphone and use this signal as the input for another encoder. It seems UWP always return fixed audio sample rate which different from sample rate my encoder wants. WASAPICapture return 44100 Hz signal, 2…