Hi,
I want to try creating a program that records samples from a sound card or opens a wave file and then I want to be able to modify the sampled bytes directly before outputting them to the sound card. Does anyone know how this can be done?
Thanks,
Programinator
I want to try creating a program that records samples from a sound card or opens a wave file and then I want to be able to modify the sampled bytes directly before outputting them to the sound card. Does anyone know how this can be done?
Thanks,
Programinator
You want to record, DSP, and then output on the fly?
Yes, I want to record, DSP then output. I want to make a music synthesiser which allows you to record a sound then it creates a table with that sound in all the different music keys (frequencys)
I really just want want to know the best way to access the soundcard (APIs or otherwise) :)
Look at the Multimedia Audio section of the Platform SDK -- functions like waveInOpen, waveOutOpen etc.
yeah... u will have to keep short buffers to minimize the latency
there is a trick u do, having 2 buffers and swapping them as soon as one of them is done, but both are always queued at any time with waveInPrepareHeader or somethin g like that
there is a trick u do, having 2 buffers and swapping them as soon as one of them is done, but both are always queued at any time with waveInPrepareHeader or somethin g like that
programinator, look up DirectSound. It's the way to fly.
something to start with....
here's a directsound example
http://members.home.nl/siekmanski/playsound.zip
here's a directsound example
http://members.home.nl/siekmanski/playsound.zip
Duplex software performs best with DirectSound + WDM streaming.
I have Audigy1 sndcard, and a high-end PC (thus, cpu power won't affect results), and these are the minimum latencies for each of the 3 implementations:
waveOut - 40ms
DirectSound, default settings - 20ms
DirectSound, WDM streaming - 5ms (probably can go even lower on better soundcards+drivers)
This is the one-way latency (thus, double the numbers for the overall one)
I just found about WDM streaming, and now I'm trying to implement it (in asm).
It's great that we don't have to make ASIO wrappers and all, to achieve low latency on Audigy :D
I have Audigy1 sndcard, and a high-end PC (thus, cpu power won't affect results), and these are the minimum latencies for each of the 3 implementations:
waveOut - 40ms
DirectSound, default settings - 20ms
DirectSound, WDM streaming - 5ms (probably can go even lower on better soundcards+drivers)
This is the one-way latency (thus, double the numbers for the overall one)
I just found about WDM streaming, and now I'm trying to implement it (in asm).
It's great that we don't have to make ASIO wrappers and all, to achieve low latency on Audigy :D
Studied a bit the srccode of PortAudio, turns out WDM streaming (aka KS) isn't a part of DirectSound.
Instead, we have to load KsUser.dll , and use "pins" - a DirectShow complexity. KS takes up the audiocard for itself, thus doesn't allow for other apps to play/record sound. Thus, removes the extra-latency, induced by the kmixer (which is usually tens of ms).
So, a bit more reallistic latencies are:
waveOut - 200+ ms
DirectSound - 40+ ms
KS - 5 ms
ASIO - 2ms (96samples @ 48kHz)
The first two methods are very dependant on sndcard, OS, drivers, polling/events, and one environmental variable.
lol Now I see that using DirectSound is a walk in the park, compared to KS and ASIO.
Instead, we have to load KsUser.dll , and use "pins" - a DirectShow complexity. KS takes up the audiocard for itself, thus doesn't allow for other apps to play/record sound. Thus, removes the extra-latency, induced by the kmixer (which is usually tens of ms).
So, a bit more reallistic latencies are:
waveOut - 200+ ms
DirectSound - 40+ ms
KS - 5 ms
ASIO - 2ms (96samples @ 48kHz)
The first two methods are very dependant on sndcard, OS, drivers, polling/events, and one environmental variable.
lol Now I see that using DirectSound is a walk in the park, compared to KS and ASIO.