Archived

This topic is now archived and is closed to further replies.

gzito

24-bit sound capture

Recommended Posts

Please can you tell me if IDirectSoundCapture8 does support 24-bit or 32-bit audio capture? If yes, can you show me a short code fragment to setup the WAVEFORMATEX part in capture buffer creation (for 24 or 32 bits) ? -G.Z.- Edited by - gzito on November 6, 2001 5:59:25 AM Edited by - gzito on November 6, 2001 5:59:58 AM

Share this post


Link to post
Share on other sites
Hi there !

Just to make this short. I think that not Direct Sound is your
problem but your Soundcard. Those in general only (normally)have 24 Bit A/D Converters from which in the end only 16 Bit are used.
I''m not saying that there are none with more than 16 Bit processing but they definately expensive as hell.

About DirectSound I dunno but the calls are still the same.

WAVEFORMATEX wfx;

wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nChannels = 1;
wfx.nSamplesPerSec = 44100;
wfx.wBitsPerSample = 24; // ( 32 if you want )
wfx.nBlockAlign = wfx.wBitsPerSample/8 * wfx.nChannels;
wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec;
wfx.cbSize = 0;

That should do the job !

If you really have a soundcard that capable please lemme know
type n price. Thanks.

Share this post


Link to post
Share on other sites
The question is: can I use DirectSound to capture audio in 32-bit or 24-bit format "if hardware sound card can do it" ?

I''m in doubt because looking at DSCCAPS in DX8SDK docs I
see that the dwFormats field doesn''t include values representing 32-bit neither 24-bit wave format.

The code you post doesn''t work because when using a wFormatTag value of WAVE_FORMAT_PCM you cannot specify wBitsPerSample other than 8 or 16. WAVEFORMATEX structure is not sufficient: you **MUST** use WAVEFORMATEXTENSIVE structure instead, and specify WAVE_FORMAT_EXTENSIVE format tag. Using WAVEFORMATEX results in
a DSERR_BADFORMAT error.

The sound card is RME Hammerfall, price is about $1000,
it''s a professional sound card, not for games, and support
32-bit audio capture as well as 32-bit audio playing.

I need capture audio data in 24 (or 32) bit format, from here I have produce a true 24-bit (32-bit) wave file. 16-bit audio is simple not enough for me.

Anyone out there has successfully captured or played true 32-bit (or 24-bit) audio data using DirectSound?

-G.Z.-

Share this post


Link to post
Share on other sites