Jump to content
  • Advertisement
Sign in to follow this  
Hermes

Playing wav files-edited topic

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

Ok i've been thinking about my problem and i guess i've found it. Let's say I want a buffer to accomodate 4000ms(4 sec)of sound ,how can i determine the buffer's dimension? Do you know the approximate limitation of SRAM? I appreciate all your efforts,i'm really stuck [Edited by - Hermes on September 4, 2004 4:18:02 AM]

Share this post


Link to post
Share on other sites
Advertisement
Just thought I might say this, since you're new. . .you won't have any luck with such a post. Generally, people on the boards like to see two things at least:

1. That you've been able to pinpoint a small amount of code where the problem lies.

2. That you've shown some effort to solve the problem, rather than simply coming to ask.

I really don't know much about sound, as I just let DirectX handle it all for me, but I thought I'd mention that, so that you will have better luck getting your question answered.

--Vic--

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You should've used the following statement in Wave.cpp to allocate memory for CWave::data:

data=new char[###]

Substitute "###" for the size of the array.

In the destructor of the CWave class, you're gonna wanna use the following delete statement:

delete []data;

Since you're new, I'd recommend using new to allocate dynamic memory and delete to delete such memory. That malloc() you use in Wave.cpp and the free() you use in Player.cpp are sooo C-style.

In the constructor of the CWave class, you assign values like 0.0 and 0.0f to long variables. Don't.

I'm gonna agree with the previous poster on this one.

Well, it's late. You know what that means. :)







Share this post


Link to post
Share on other sites
To determine the size of the buffer, you can get the average bandwidth of the stream from the WAVEFORMAT structure's nAvgBytesPerSec member.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!