Sign in to follow this  

Playing wav files-edited topic

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
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.


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this