Jump to content
  • Advertisement

Archived

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

Mafian

Creating a Secondary Sound Buffer

This topic is 5685 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

I cannot, for the life of me, figure out what is wrong with this piece of code for creating a secondary sound buffer!!!
      
	//Setup format data struct

	WAVEFORMATEX pcmwf;
	memset(&pcmwf, 0, sizeof(pcmwf));

	pcmwf.wFormatTag = WAVE_FORMAT_PCM;
	pcmwf.nChannels = 1;
	pcmwf.wBitsPerSample = 8;
	pcmwf.nSamplesPerSec = 11025;
	pcmwf.nBlockAlign = (pcmwf.nChannels * pcmwf.wBitsPerSample) / 8;
	pcmwf.nAvgBytesPerSec = pcmwf.nSamplesPerSec * pcmwf.nBlockAlign;
	pcmwf.cbSize = 0;

	//sound buffer

	DSBUFFERDESC dsbd;
	dsbd.dwSize = sizeof(dsbd);

	dsbd.dwFlags = controlflags | DSBCAPS_STATIC | DSBCAPS_LOCSOFTWARE;
	dsbd.dwBufferBytes = child.cksize;
	dsbd.lpwfxFormat = &pcmwf;

	//create sound buffer

	if(m_SRes->m_lpds->CreateSoundBuffer(&dsbd, &m_OriginalBuffer, NULL) != DS_OK)
	{
		delete[] snd_buffer;
		return -7;
	}
      
Variables: -child.cksize = 11300 -m_SResz->m_lpds has been set up correctly (Im pretty sure) -control flags = DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLFREQUENCY [edited by - Mafian on January 22, 2003 7:24:04 PM] [edited by - Mafian on January 22, 2003 7:25:09 PM]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!