Tuesday 22 May 2012

Sound API and How That is Used As Well?

Sound Application Programming Interface
 What is done with a Sound Application Programming Interface?

A sound API works the same way as the graphical API with it being able to control and create the dynamics to the graphics which appear in a game or application. This works the same way as the sound API with it being able to control the way the sound is heard, recorded and played back to the person listening. The API used would allow for effects to be added, the way the audio is played to altered and the overall quality of the audio or sound to be clear and audible without distortion. They're two API's I will be looking at in details which I will be looking at what they provide for sound in terms of their features and how they help with outputting sound. I will be looking at OpenAL & Java Sound API.

OpenAL stands for Open Audio Library which is used directly with gaming and other software applications, and uses a listener, a source and a buffer. The listener would be the person who would be walking around or roaming during gameplay, such as walking down a path, the source would be where the sound would come from and the buffer would buffer the sound once the listener has reached the source. Within the 3D environment of the game several sources will be placed with different sounds gathered or retrieved from the Audio Library, once the listener has reached this point depending on the distance or closeness to the source depends on the buffering stage, the closer the louder, the further away the quieter it will need to buffer the sound. The rendering of such sound is done by the listener meaning that as it enters the source for the sound, it is rendered similarly to the way that graphics are rendered whilst the person moves towards them. Once the sound has been rendered and buffered it can then be heard and outputted from the source. Several sources will be setup around an entire game are can in some cases be linked to other AI objects such as people and or characters, each having their own set of sources depending on the part of the game.

The Java Sound API works in a similar way working with audio playback, audio recording and audio effects/creation. Java API allows for sound to be outputted during a game when again a event is triggered or a person reaches a certain area or part of the game. The API allows for several audio files to be played at once meaning a background audio file can be playing whilst on top of this audio files for birds are playing with water moving sounds. Java API can also convert the sound or lyrics of a song or audio file so that they are outputted as subtitle however this is not usually used as the parsing stage can be quite complex due to the amount of noise an audio file outputs.