Home > Failed To > Idirectsoundbuffer Play

Idirectsoundbuffer Play

Contents

Sign up now 0 DirectSound-Lock() function: Invalid Parameters. (C++) Started by Luhz, Jun 22 2006 11:20 AM Old topic! The classes show you how to manage the DirectSound resources, and the CWaveFile class has interfaces to read various sound files. SSE3.. SSE4.2.. Check This Out

If the method fails, the return value may be one of the following error values: DSERR_BUFFERLOST DSERR_INVALIDCALL DSERR_INVALIDPARAM DSERR_PRIOLEVELNEEDED Remarks This method accepts an offset and a byte count, and returns Have a look at the cursor calculations and see if they match yours.NOTE: m_pData is a pointer to a file system class.deBoolean IdeSoundBuffer_DS::Update(){ HRESULT hres; uint8 *ptr1, *ptr2; DWORD size1, size2; Back to top Back to DirectX and XNA Old topic! Also, the buffers work for the first load (filling the entire buffer), and are able to play sounds loaded in them (things smaller than the buffer size (or partial large sounds

Idirectsoundbuffer Play

AVX Reserving memory for recompilers... ppvAudioPtr1 Address of a variable that receives a pointer to the first locked part of the buffer. Can someone please move this? « Last Edit: 23 August 2010, 21:51:55 by Mukora » Logged Mukora Daemon Posts: 9 Re: [solved] Exception: Failed to Lock Direct sound buffer « Reply memcpy(write1, sounds[id]->data+sounds[id]->read, rsize1); sounds[id]->read += rsize1; sounds[id]->sizelwrite = rsize1; if(rsize2 > 0) { if((sounds[id]->size - sounds[id]->read) > rsize2) { memcpy(write2, sounds[id]->data+sounds[id]->read, rsize2); sounds[id]->read += rsize2; sounds[id]->sizelwrite += rsize2; } else {

Drawing on his in-depth industry experience, the authors take programmers through the complete process of developing a professional-quality game using hundreds of Preview this book » What people are saying-Write a Login Register Login Username: Password: Lost Password? Back to top ' #16 paradoxnj Members 208 Like 0Likes Like Posted 25 June 2006 - 01:54 AM Problem with doing that is not all of your files will We appreciate your feedback.

i downloaded directx 9.0cinstalled it then used dxdiag to set my acceleration to off. « Last Edit: 1 January 1970, 00:00:00 by djbded » Logged Print Pages: [1] MegaGlest Forum » Idirectsoundbuffer8 Release It starts up fine, but if I try to boot (even with no CD as I mentioned), that's where it crashes. We appreciate your feedback. Someone please help me!

lplpvAudioPtr1 Address of a pointer to contain the first block of the sound buffer to be locked. unsigned long size; //Total size of file LPDIRECTSOUNDBUFFER8* lbuff; //Buffer being used by this sound }; Sound** sounds; //Storage for Sounds sounds = new Sound*[size3]; void StreamWAV(int id) { HRESULT check; Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 240GB SSD | 3 TB HDD | 1 TB HDD | 500GB HDD Server: AMD FX 6300 @ This parameter is ignored if DSBLOCK_FROMWRITECURSOR is specified in the dwFlags parameter.

Idirectsoundbuffer8 Release

How many seconds are you buffering? Sorry to bother you:LockBuffer(void){ BYTE *lplpPoint1, *lplpPoint2; int length1, length2; DSBuff->Lock(0,4000,(void**)&lplpPoint1,&length1,NULL, &length2, DSBLOCK_ENTIREBUFFER ); return 0;}CreateBuffer(void){ lpDS->CreateSoundBuffer(&DSBuffDesc, &DSBuff, NULL); return 0;}Thanks very much,WilbenPS If I keep this number of posts up, Idirectsoundbuffer Play Reply to quoted postsClear » Forums » Home » Forums » The Technical Side » DirectX and XNA Change Theme IP.Board GDNet 3.4.1 GDNet 6.0 English (USA) English (USA) English Directsound Example Members 122 Like Likes Like Posted 19 March 2000 - 05:09 AM HiCould it be that your DSBuff is pointing to NULL, thatcould be the cause for the Access

Back to top ' #19 Luhz Members 109 Like 0Likes Like Posted 29 June 2006 - 10:20 AM Avast, you are correct, and that pretty much destroys my whole his comment is here Username or email: Forum Password I've forgotten my password Remember me This is not recommended for shared computers Sign in anonymously Don't add me to the active users list Privacy Policy Username or email: Forum Password I've forgotten my password Remember me This is not recommended for shared computers Sign in anonymously Don't add me to the active users list Privacy Policy if (FAILED(lpds->SetCooperativeLevel(game, DSSCL_PRIORITY))) { AddError(SND_SETCOOP_FAIL); return false; } //Create Primary Buffer DSBUFFERDESC dsbd; ZeroMemory(&dsbd, sizeof(DSBUFFERDESC)); dsbd.dwSize = sizeof(DSBUFFERDESC); dsbd.dwFlags = DSBCAPS_CTRL3D | DSBCAPS_PRIMARYBUFFER; if(FAILED(lpds->CreateSoundBuffer(&dsbd, &lpdsb, NULL))) { AddError(SND_CREATEPRIMARYB_FAIL); return false; }

Link Library: Dsound.lib. if(SUCCEEDED(lpds->CreateSoundBuffer(&dsbdesc, &pDsb, NULL))) { pDsb->QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*) ppDsb8); pDsb->Release(); } else { AddError(SND_SECONDARYB_FAIL); return false; } return true; } I use an array of buffers, all with the same settings and size Can someone please tell me how to get locking and unlocking a DSound buffer to work? this contact form Changing the last param to 0 doesn't fix it.

You cannot reply to this topic 6 replies to this topic ' #1 Wilben Members 122 Like Likes Like Posted 18 March 2000 - 04:30 AM Hello, I''ve got That''s what they''re there for. If that fails google for Directx web installer and run that.

Requirements OS Versions: Windows CE 2.12 and later.

The following flags are defined: ValueDescription DSBLOCK_FROMWRITECURSORStart the lock at the write cursor. Binding GS: C:\Program Files (x86)\PCSX2 1.0.0\Plugins\gsdx32-sse4-r5350.dll Windows 6.1.7601 (Service Pack 1 1.0) Binding PAD: C:\Program Files (x86)\PCSX2 1.0.0\Plugins\lilypad-r5350.dll Binding SPU2: C:\Program Files (x86)\PCSX2 1.0.0\Plugins\spu2-x-r5350.dll Binding CDVD: C:\Program Files (x86)\PCSX2 1.0.0\Plugins\cdvdGigaherz.dll Binding When attempting to change the algorithm for calculating those values several times, I discovered that the lock will succeed the first 5 times, then fail on the next lock (which would For example, if the buffer is located in on-card memory, the pointer might be an address to a temporary buffer in system memory.

I keep getting errors about Access Violations and also on how I''ve got basicly nearly all of the parameters wrong. When I output these values for each Lock() failure, I see the same results every time: the write offsets and size fully comply with the requested Lock values, despite the error. I was stupid and posted this in the wrong section. navigate here So here is an example of locking the 4000 bytes sound buffer:BYTE *ptr_audio1,*ptr_audio2;int length1,length2;if(FAILED(lpdsbuffer->Lock(0,4000,(void **)&ptr_audio1,&length1,(void **)&ptr_audio2,&length2,DSBLOCK_ENTIREBUFFER))){ // error}Once you''ve locked the buffer, you''re free to write into the memory.

If the value of this parameter is NULL, the lplpvAudioPtr1 parameter points to the entire locked portion of the sound buffer. If the lock does wrap, ppvAudioBytes2 points to the beginning of the buffer. If the method fails, the return value may be one of the following error values: Return code DSERR_BUFFERLOST DSERR_INVALIDCALL DSERR_INVALIDPARAM DSERR_PRIOLEVELNEEDED Remarks This method accepts an offset and a byte count, Take a look for function prototype for Lock():HRESULT Lock( DWORD dwWriteCursor, // position of write cursor DWORD dwWriteBytes, // size to lock LPVOID lplpvAudioPtr1, // pointer to first chunk LPDWORD lpdwAudioBytes1,

They have 3 classes setup in the DXUTsound.h and .cpp files in their common directory. They are very useful.In addition, you can also just maintain an array of buffers and have a flag for active/inactive. Home Help Search Login Register MegaGlest Forum » Archives (read only) » Vanilla Glest » Bug report » failed to lock direct sound buffer Pages: [1] Print Author Topic: failed to Welcome, Guest.

I have no clue what's causing it. Also, this may sound stupid but, instead of NULL for the last parameter, use 0. Like our Facebook Page and visit our Facebook Group! You usually want to buffer about 1 or 2 seconds.Are you calling your update function every frame or are you using a thread?