Original Post
🔒 Locked
Capturing from DirectSoundBuffer
Advertisement
I am a bit confused by your question. If you are using DirectSoundCapture, that is recording incoming data off your soundcard, then there is only one buffer. There are no secondary, primary, or static buffers.
If you are talking about looking at what the primary buffer of a ''play'' or ''send'' operation is, the answer is that I don''t know...at least I don''t know how to directly read the primary buffer output. Then again, by its very definition, I think that the primary buffer is essentially the hardware and it''s the soundcard''s property.
You could always take the output and feed it into the input and capture it.
However, my soundcard (Soundblaster Live) has a nice mixer option where you can choose "What you hear" as a record option. This feeds the hardware output into the input buffer without making any physical connection. You still have to write the capture code, however (this is what I do). Fortunately, it is easier to write capture code than send code (surprisingly) as the notify technique works much better without sacrifice. Using the notify event stuff on a send buffer may lose you hardware accelleration and gives you other grief. I just discovered a third grief...even with the same sample rate, same bit depth, and same number of channels, the "send" rate and the "receive" rate are not the same. I plan to post that question here.
Still, there may be a way to actually get the output of the Primary buffer via DirectSound, though I know of no method in the hierarchy that achieves this.
It is unfortunate that it is quite difficult to find much expertise on DirectSound. The graphics side of DirectX blossoms with knowledge and expertise!
Brian
If you are talking about looking at what the primary buffer of a ''play'' or ''send'' operation is, the answer is that I don''t know...at least I don''t know how to directly read the primary buffer output. Then again, by its very definition, I think that the primary buffer is essentially the hardware and it''s the soundcard''s property.
You could always take the output and feed it into the input and capture it.
However, my soundcard (Soundblaster Live) has a nice mixer option where you can choose "What you hear" as a record option. This feeds the hardware output into the input buffer without making any physical connection. You still have to write the capture code, however (this is what I do). Fortunately, it is easier to write capture code than send code (surprisingly) as the notify technique works much better without sacrifice. Using the notify event stuff on a send buffer may lose you hardware accelleration and gives you other grief. I just discovered a third grief...even with the same sample rate, same bit depth, and same number of channels, the "send" rate and the "receive" rate are not the same. I plan to post that question here.
Still, there may be a way to actually get the output of the Primary buffer via DirectSound, though I know of no method in the hierarchy that achieves this.
It is unfortunate that it is quite difficult to find much expertise on DirectSound. The graphics side of DirectX blossoms with knowledge and expertise!
Brian
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement