Jump to content
  • Advertisement
  • entries
    205
  • comments
    228
  • views
    113446

Success??

Sign in to follow this  
Mike Bossy

81 views

I think I have my audio problem from last night fixed. It ends up that the DMusic loader "tries" to help you out by caching data so you don't end up loading things over and over again. Seeing as I already have a resource manager that handles that it's not too much of a help for me. What's worse is that if you try to load an audio file from a buffer that happens to start at the same address of a previous buffer of data then it assumes that you want a cached copy of the old data. It doesn't matter if the new data you're giving it is 65k long and the previous data was only 12k long. It kindly just gives you a copy of the 12k data.

So with that figured out I set about stopping the caching. Low and behold there's a method on the loader to turn caching off. But when I do that I end up getting nothing from the loader when I have what would be a cache hit. So instead of getting the wrong clip I get nothing! This I believe is a DirectX bug but since DX8.1 is long since dead I'm guessing I'll never know for sure.

The good news is that I found another method that simply allows you to clear the cache. So leaving caching on and simply clearing the cache after each load now seems to work. I'm getting all of the right sounds at the right times. Lets hope it stays that way.

The lessons learned from today's work are:

1. If you're going to "try to help" at least try to be smart. Check that the data I'm trying to load not only comes from the same memory location but also has the same size, format, etc.

2. Don't let a bug block you. Go with the not so elegant solution if it works.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!