Jump to content

  • Log In with Google      Sign In   
  • Create Account

Playing Direct Sound files at the same time


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 01 December 1999 - 01:29 AM


I've got Direct Sound working OK
but if I want to play the same sound
at the same time I have to load up a
separate copy. As an example you
have two machine gunners fireing
and one starts just before the other.
If want to hear them both you have to
load and play two separate sounds.
If you have 10 machine gunners
you would have to load 10 machine gun sounds which would eat memory.
Is there a way to play the same sound
several times at the same time and only use the one piece of memory?


Sponsor:

#2 Tuan   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 November 1999 - 03:27 PM

You can map your sound file into memory with File Mapping technique, and then you can use memcpy function to fill your Direct Sound buffers. It means when you use the File mapping, you can access your file randomly, as RAM.

#3 VirtualNext   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 December 1999 - 01:29 AM

Hello Davaris

A more easily method than Tuan described is to use IDirectSound: uplicateSoundBuffer like that:

pDS; // the directsound object
pDSB1; // i assume that this is your original soundbuffer which is properly initialized
pDSB2; // the second one

pDS->DuplicateSoundBuffer(pDSB1, pDSB2);

Please look at the DX7 SDK documentation for more details.

VirtualNext





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS