• Advertisement

Archived

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

Accurate Way Of DirectSound3D?

This topic is 5778 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What''s the correct way of using DirectSound3D under DirectX 8.0? Ive done these steps: InitializeDSound Create The Primary Buffer Acquire3DListener Then In The Wave Loader ReadWaveSettings (Channels.. etc) CreateSoundbuffer Acquire3DSoundBuffer But what about the GOD DAMN WORTHLESS lock function? what are all the pointers... seems so veeery dumb...

Share this post


Link to post
Share on other sites
Advertisement
maybe you should read the sdk docs and unserstand things instead of copying code. cause is it the lock function that is dumb or you?

Share this post


Link to post
Share on other sites
What?
Do you got any problems reading? I Hasn''t copied the code, It just that function that''s comfuses me, vut since you seems like the perfect human (Or..) it seems impossible to get information from YOU!

Someone else?

Share this post


Link to post
Share on other sites
if the function confuses then you should post how it confuses not that it is dumb. it works perfectly fine is a well thought out way to handle a circular buffer. basically the first pointer is the first part of the two part buffer returned. the seconde pointer if not NULL points to the second part of the buffer. this is because as the docs state that the dsound buffer is circular. this means that when you hit the end you start back at the beginning so you need the second pointer when you lock a section of bytes that crosses the end.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hi !
you''re already @ lock - function for directSound, so i''m going to misuse this thread for my own problem

the soundbuffer->lock() function seems not to work right, if the buffer has the flag DSBCAPS_LOCSOFTWARE set... only works in hardware memory...


if i lock a part of a buffer, that''s in "software memory", the lock()-function returns DSERR_INVALIDPARAM.
[lock (writeCursor, writeLen, ..., 0);]

when i lock the entire buffer (in software mem) everything works fine.
[lock (0, 0, ..., DSBLOCK_ENTIREBUFFER);]

for buffers in hardware memory, both of these work right.

i''m absolutely sure, all parameters are right... so what can be the problem ?

Share this post


Link to post
Share on other sites
hi !
you''re already @ lock - function for directSound, so i''m going to misuse this thread for my own problem

the soundbuffer->lock() function seems not to work right, if the buffer has the flag DSBCAPS_LOCSOFTWARE set... only works in hardware memory...


if i lock a part of a buffer, that''s in "software memory", the lock()-function returns DSERR_INVALIDPARAM.
[lock (writeCursor, writeLen, ..., 0);]

when i lock the entire buffer (in software mem) everything works fine.
[lock (0, 0, ..., DSBLOCK_ENTIREBUFFER);]

for buffers in hardware memory, both of these work right.

i''m absolutely sure, all parameters are right... so what can be the problem ?

Share this post


Link to post
Share on other sites
YEAH ! already found that one !

it was just another chapter of experiencing c++ data-types & (especially) arrays. i just don''t get how these work.

i used these lines :
--------------------------------
LPVOID Tile[2];
DWORD TileLen[2];
buffer->lock (writeCursor, writeLen, &Tile[0], &TileLen[0], &Tile[1], &TileLen[1], 0);
--------------------------------
which lead to...
-> DSERR_INVALIDPARAM
================================

now i changed this to :
--------------------------------
LPVOID Tile0, Tile1;
DWORD TileLen0, TileLen1;
buffer->lock (writeCursor, writeLen, &Tile0, &TileLen0, &Tile1, &TileLen1, 0);
--------------------------------
and it worx perfectly !!
well... i don''t really get it, but... happy it worx !
================================

i just don''t understand arrays & pointers to arrays & so on in C++... i was once pascal-programmer... and everything was soooo easy

Share this post


Link to post
Share on other sites

  • Advertisement