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
1
vote
0 answers

WASAPI audio recording device positions - GetBuffer() vs GetPosition()

I am trying to get a precise estimation of audio recording timestamps and got some weird behavior: Initially I assumed I can rely on the position and performance counter returned by IAudioCaptureClient::GetBuffer. I assumed that these timestamps…
Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71
1
vote
2 answers

WASAPI: Identify non-active channels on loopback recording

I have a DSP software which captures the audio playing using the WASAPI api in shared loopback mode. hr = _pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_LOOPBACK, 0, 0, _pFormat, 0); This part works fine, but now I want to…
1
vote
0 answers

CSCore 2 vs 6 channels RMS

I am calculating RMS from WasapiLoopbackCapture and when using 5.1 speakers, it gives me RMS values between 0 and 2, (with headphones, it gives RMS up to 130). How can I get only audio data from two channels? I tried to set number of channels to…
TheSpixxyQ
  • 744
  • 1
  • 6
  • 16
1
vote
1 answer

NAudio with MultiplexingSampleProvider and WasapiOut

I've been working on a C# project with NAudio where I need to send specific Audio signals to specific speakers on a 4 channel system. Basically, I need to send 'Environmental sounds' to the back left speaker, 'Front Panel display sounds' to the…
JonDemers
  • 11
  • 5
1
vote
0 answers

How WINAPI handle IAudioClient->SetEventHandle() works?

I'm writing an application that reading audio endpoint on windows, via WASAPI. For now I have similar code for capture thread (treat this code as minimal example): DWORD CWASAPICapture::DoCaptureThread() { BYTE *pData; UINT32 framesAvailable…
Liastre
  • 1,281
  • 11
  • 29
1
vote
1 answer

Low latency (<10ms) buffers for USB audio drivers in Windows 10?

I've been working on some WinAPI code to try to get audio latency as low as possible in Windows 10 natively. I eventually found this documentation which indicates the WASAPI in Windows is the lowest level you can get to, and there are even some…
Max
  • 123
  • 2
  • 9
1
vote
0 answers

C# Stream Program Output to an Audio Input Device

I have a program that generates a PCM Audio stream (as a MemoryStream). I want to send this to an audio input (recording) device in windows so that an application that is set to get input from that recording device will get the output generated by…
Sudhashbahu
  • 209
  • 3
  • 13
1
vote
2 answers

Convert Audio data in IeeeFloat buffer to PCM in buffer

I use NAudio to capture sound input and the input appears as a buffer containing the sound information in IeeeFloat format. Now that I have this data in the buffer, I want to translate it to PCM at a different sampling rate. I have already figured…
Sudhashbahu
  • 209
  • 3
  • 13
1
vote
0 answers

C++ PCM capture to wave file, poor quality

I try to capture and save the audio loopback stream of my computer. I use the example code of the MSDN. I can capture the sound to a wave file and I can play it, but the sound quality is horrible (a lot of static, the sound is sputtering). I can't…
tankyx
  • 87
  • 1
  • 10
1
vote
1 answer

When does WASAPI GetNextPacketSize return 0

The sample code of WASAPI capture on MSDN, loops till the GetNextPacketSize return 0. I just want to understand when will this happen: Will it happen if there is silence registered on the microphone? (In this case will it loop infinitely if i keep…
Nitin
  • 55
  • 1
  • 7
1
vote
1 answer

wasapi: detect that nothing are played (device is not in use)

I use wasapi for loopback capturing. All data after that are saved to wav file. When it starts capturing it delivers data all the time until I stop capturing process, even if no application use audio device and thus no one produces music. As a…
DotNetter
  • 426
  • 2
  • 6
  • 19
1
vote
2 answers

How do you find the audio latency ? (Windows/OSX)

I'm writing a music application, but I have no clue how applications such as Ableton/Cubase/etc find the audio latency of a system (do they ?) so they can compensate for time difference when recording/playing. Meaning, the audio input latency (from…
Robin Lobel
  • 630
  • 1
  • 5
  • 16
1
vote
1 answer

Infinite loop reading packet data in 1sec loopback recording

I ported the MSDN capture stream example - https://msdn.microsoft.com/en-us/library/windows/desktop/dd370800 and modified it for loopback, exactly as seen here -…
Noitidart
  • 35,443
  • 37
  • 154
  • 323
1
vote
1 answer

NAudio - Using WaveIn and AudioEndpointVolume together

In my app I'm using WaveIn to record from mic, and allow my client to adjust the recording level using AudioEndpointVolume. I didn't had any problems so far, but since my client may have a different sound card, I would like to ask if this…
Bohoo
  • 1,099
  • 11
  • 25
1
vote
0 answers

Loopback recording on Windows using GStreamer

How can I record system sounds and sounds played by other apps? I tried directsoundsrc and wasapisrc with no luck. DirectSound seems to be unable to capture from Speakers (devices listed by DirectSoundEnumerate). DirectSoundCaptureEnumerate returns…
Kyrylo Polezhaiev
  • 1,626
  • 11
  • 18