Since we're still working on whatever little bugs arise in our almost polished product, there's not too much in the way of interesting programming challenges in what is now Amoebageddon. That said, today was a nice and slow day. Until I came back to working with DirectX 11 and decided to implement sound. The problem was, how?
DirectSound, however deprecated, was a possibility. Unfortunately, the tutorial and other resources I found noted that the control was so in-depth that I had to be very specific about what types of sound files I used. Ugh. This definitely doesn't come in handy when you use online converters. I also considered using the original Windows API for this, but PlaySound, along with demanding the FULL ABSOLUTE PATH of the sound (Heck, and let's not get started about TCHAR arrays and getting the current directory each time), also does not support sounds larger than 1 MB. These limitations really need some fine print.
In looking in a few other places, I noted a library that was highly recommended, the Simple and Fast Multimedia Library (here). Luckily, the methods were quick, simple, and looked as if I only needed to use a sliver of the library for quick and efficient loading of sounds and music.
Problem? The formats were very specific, so I tried using all sorts of things. Turns out SFML is picky about what sounds it uses for which (.wav for sounds, .ogg for music) without too much warning, and the libraries for each build (Debug/Release) are different. After all this, I think I finally found a suitable replacement for DirectSound when it comes to audio loading for engines. Since it's difficult to note a change in sound (creepy music, in this case) for a project, I changed the fog value of the scene involving a ball in a snowland to reflect this:
Imagining a spooky .ogg music file playing over this will fit nicely with the overall product. Hopefully I can get on to working on more fun challenges once the next prototype starts up.
No comments:
Post a Comment