




| DirectX Audio Programming |
|
|
|
| Written by Zamrony P. Juhara |
| Friday, 06 November 2009 16:39 |
|
Page 1 of 8 (This article was first published on PC Media magazine edition 08/2007)After quite enough playing with 3D graphics programming on Direct3D in previous articles, to avoid you get bored, I want to explore other interesting programming topic, i.e, sound programming with other DirectX component, DirectX Audio. What I want to discuss with you this time is basic information about DirectX Audio including: DirectX Audio architecture, most frequent used terminologies and of course, the most interesting part, how to use DirectX Audio to play audio file. Why DirectX Audio?Windows had multimedia feature through Multimedia Control Interface (MCI), Wave API and MIDI API. For simple applications, MCI is capable to be used for playing WAV file or MIDI.But, if you need to develop riched-feature sound recording application, such as Cakewalk's products, or game with impressive sound quality, MCI is not suitable. DirectX Audio was presented by Microsoft for high performance audio application development on Windows platform. With DirectX Audio, you are able to do following things with ease:
DirectX Audio ArchitectureDirectX Audio consists of two components, i.e DirectSound and DirectMusic. DirectSound, which was created first, was designed for fast and efficient audio hardware access. DirectSound provides low-level mechanism for direct access to audio hardware. DirectMusic, which was created later after DirectSound, provides low-level programming interface for MIDI device, called DirectMusic Core and high level programming interface for loading and playback of music media, called DirectMusic Performance.
PerformancePerformance is the work-horse of DirectX Audio. Performance is responsible for audio initialization, scheduling segments, creating and mapping audiopath to segment also controlling sound playback. LoaderLoader was created to handle file input/output task and to load audio data from memory or resource. Loader simplifies programmer's task to load audio data. SegmentSegment represents any playable audio data. It can be in form of MIDI file or wave file or DirectMusic Segment (default format of DirectMusic with SGT file extension). You can create one or more segments in an application. You are even allowed to play two or more segments simultaneously. AudioPathAudioPath is DirectMusic object responsible to manage route that must be taken by music instrument or sound effect. Each segment is played through an audiopath. Applications can have one or more audiopaths. |
| Last Updated on Friday, 13 November 2009 15:09 |