Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 9,630 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: snd_play() delay, ent_playsound() not threadsafe [Re: Dark_samurai] #288133
09/04/09 12:01
09/04/09 12:01
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Maybe it's the buffer flags. We use:

DSBCAPS_CTRL3D|DSBCAPS_CTRLFREQUENCY|DSBCAPS_CTRLVOLUME|DSBCAPS_MUTE3DATMAXDISTANCE

and also DSBCAPS_LOCSOFTWARE when hardware mixing is not supported.

Re: snd_play() delay, ent_playsound() not threadsafe [Re: jcl] #288197
09/04/09 17:17
09/04/09 17:17
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Hiya Dark_samurai don't know if this bit of code is usefull or not but it may give you some idea of how DSOUND is initilized.
It's not the full code just bits and peices of it.
Code:
WAVEFORMATEX wave;
   memset(&wave, 0, sizeof(WAVEFORMATEX)); 
   wave.wFormatTag = WAVE_FORMAT_PCM;
   wave.nChannels = 1; 
   wave.nSamplesPerSec = 44100; 
   wave.nAvgBytesPerSec = 176400;
   wave.nBlockAlign = 4;
   wave.wBitsPerSample = 16;	
   wave.cbSize = 0;

//   wave.nBlockAlign = wave.wBitsPerSample / 8 * wave.nChannels;
//   wave.nAvgBytesPerSec = wave.nSamplesPerSec * wave.nBlockAlign;

   DSBUFFERDESC dsbdesc;
   memset(&dsbdesc, 0, sizeof(DSBUFFERDESC)); 
   dsbdesc.dwSize = sizeof(DSBUFFERDESC); 
   dsbdesc.dwFlags = DSBCAPS_LOCHARDWARE | DSBCAPS_CTRL3D | DSBCAPS_STATIC; 
   dsbdesc.dwBufferBytes = 64;  
   dsbdesc.lpwfxFormat = &wave; 

   if ( m_lpds->CreateSoundBuffer(&dsbdesc, &m_lpdsb, NULL) != DS_OK )
   {
    return FALSE; 
   }
  }




Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus
Page 2 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1