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
0
votes
1 answer

How to enumerate audio cards in win32?

Is it possible to get a list of audio cards (not endpoints) in Win32? This information would be really useful when constructing full-duplex audio streams, to be sure both input and output share the same hardware clock. So far, I found…
Sjoerd van Kreel
  • 1,000
  • 6
  • 19
0
votes
1 answer

How do i get byte[] pcmData of internal audio (Xt Audio for Java)

How do i get byte[] pcmData (just like in https://github.com/goxr3plus/Java-Spectrum-Analyser-Tutorials) but on xt audio? i wanted to draw the osc (spectrum analyzer) of the internal audio using wasapi (output speakers) of the computer real time.…
GDjkhp
  • 11
  • 5
0
votes
0 answers

IAudioClock thread safety

The documentation on the thread safety of various WASAPI interactions is lacking in clarity. For IAudioClock it does mention that IAudioClient::GetService() and the Release() of the interface obtained from that must be called from the same thread:…
iam
  • 1,623
  • 1
  • 14
  • 28
0
votes
0 answers

Efficient sampling of audio render client position

I want to efficiently monitor audio playback position. I understand I can use IAudioClock::GetPosition() and that this is a blocking call that can fail, and should not be called from a thread that is decoding or resampling the audio stream. So I…
iam
  • 1,623
  • 1
  • 14
  • 28
0
votes
1 answer

WASAPI captured packets do not align

I'm trying to visualize a soundwave captured by WASAPI loopback but find that the packets I record do not form a smooth wave when put together. My understanding of how the WASAPI capture client works is that when I call…
KyleL
  • 855
  • 6
  • 24
0
votes
0 answers

This code will generate a wav file but does not contain any recording

This code will generate a wav file but does not contain any recording // Define the output wav file of the recorded audio string outputFilePath = @"C:\Users\system_recorded_audio.wav"; // Redefine the capturer instance with a new…
sameer
  • 9
  • 2
0
votes
1 answer

Why does my WASAPI listener fire even when nothing is playing?

WASAPI is documented as not sending audio data if nothing is playing any sound, e.g. this note about WASAPI in NAudio: Now there is one gotcha with WasapiLoopbackCapture. If no audio is playing whatsoever, then the DataAvailable event won't fire.…
Joshua Frank
  • 13,120
  • 11
  • 46
  • 95
0
votes
0 answers

How to get the actual buffer size in samples from a WASAPI device with NAudio?

Is there any smart way to obtain the buffer size in samples in a precise way? For the capture device and the render device. I've tried mmDevice.AudioClient.BufferSize after calling StartRecording() but it doesn't seem to contain a proper value but…
thalm
  • 2,738
  • 2
  • 35
  • 49
0
votes
0 answers

Enumerate Audio Sessions in Windows

I would like to enumerate all Audio Sessions with Windows Audio Core APIs and be able to manipulate the Sessions Volumes, but I can't find a way to enumerate the audio sessions and get some Interface like the ISimpleAudioVolume Interface. I can only…
Brainiac
  • 191
  • 1
  • 12
0
votes
1 answer

NAudio select Speaker/Headphone (Realtek High Definition Audio)

Is it possible to select Speaker/Headphone (Realtek High Definition Audio) var enumerator = new MMDeviceEnumerator(); foreach (var wasapi in enumerator.EnumerateAudioEndPoints(DataFlow.All, DeviceState.All)) { …
dwk
  • 69
  • 1
  • 9
0
votes
1 answer

How to get number of channels from audio playback devices?

The game Titanfall 2 shows the audio configuration for the playback device. https://i.stack.imgur.com/WcGpK.png Is there anything I can do to get this information via code in C#? Update & correction (September 29, 2019 at around 3:12pm UTC): The…
0
votes
1 answer

How to record a two-way conversation in UWP using speakers and microphone

I want to record a two-way conversation using a speaker and microphone in my UWP app. Currently I am able to record using a microphone, and generate an audio file using a microphone, but now I want to allow the user to select both microphone and…
Shakita
  • 99
  • 2
  • 12
0
votes
1 answer

Why is WASAPI so much slower than ASIO?

I measured the round-trip latency of RtAudio Duplex Mode example by an oscillograph. The result on the average as blow, ASIO 15ms WASAPI 50ms Why is WASAPI so much slower? All documents on the Internet says them have the same performance. OS:…
0
votes
1 answer

Record audio using NAudio Wasapi wrapper, sound file weight is not 0 but audio is blank

What is working - Save file What is not: - Audio file is blank (as a length but no audible sound, aka sound is blank) Edit (for clarity): The file weight is not 0. Already implemented a solution with winmm.dll but looking for something better than…
user10864482
0
votes
1 answer

How is stereo audio data recorded using IAudioCaptureClient?

I am recording stereo audio from line-in of the desktop using Microsoft's Core Audio API. It records at 44100Hz, 32 bit. I want to know how the stereo data is recorded into the buffer, like is it first 32 bit is of one microphone and next 32 bit is…