This is a proposal write-up for my upcoming 3-week assignment. As a part of our final project, we have to create our own engine sub-system which can be integrated in our existing system. Few of the things which should be kept in mind while designing this sub-system are:
Update - 11/08/2018xAudio2 After doing some research of various audio APIs, I have decided to go with xAudio2 for my project. xAudio2 is a flexible, cross-platform, low level audio API which came as a replacement for DirectSound for windows applications. The three main components in xAudio are:
Wave File Format In my audio engine, I am going to use the wave files (maybe I will be able to support the multiple formats, but first goal is to play a single format correctly). It is important to understand how the data is actually stored in wave files in order to play it correctly. Below are some details of a wave binary file:
Update - 11/15/2018I was able to play a wav file with my implementation this week. Though there are some errors, mostly in cleaning up of the engine system (destructors), the sound is playing fine. Below are some of the learnings and implementations I made this week:
I am expecting to update these interfaces in the coming week. As for the last week, I want to achieve at least the following:
Update - 11/21/2018Final goals achieved in this project:
To play a sound using this project, other students will only have to use the sound class. It is important to remember to include the xAudio.lib in our project before using the sound class. Also, I am using the AudioBuilder project to copy the sound file from content folder to game install directory folder (as we have done before by using AssetsToBuild.lua file). The final interface of the sound for this class looks something like this: Possible changes that could be made on this interface are:
Channels are used to play the sound. In my sound system class, I am maintaining two lists of active channels (channels which have sounds to play) and idle channels. Using these channels, we can play the multiple sounds (by making more channels active form idle). I have set the limit on number of channels to 64 (I don’t think we need more than 64) in this project. [Update 1: Added an external.windows.h file to link xAudio2.lib. Now other student won't have to write any code to use the engine. This file will be forced include to the engine library.] [Update 2: Added an interface for setting the volume and playback speed in the sound class.] Downloads Download Audio Project Download Audio Builder Application Demo Exe A looping background music is playing. 'Space' to listen to a sound effect. '+' or '-' to increase or decrease the volume.
1 Comment
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |