Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888), страница 36
Текст из файла (страница 36)
Although Symbian OS doesnot support these APIs at the time of writing, they are a good representationof the areas where Symbian will focus its audio support in the future.4.6.1 Audio Effects APIThis API is specific to S60 3rd Edition, and is an audio API for addinggeneric effects to a rendered audio stream. This API is an optional featureand S60 does not support it on every device. Even if it is supported, fullsupport of the API is not guaranteed, and only some features might be152ADDING AUDIO TO GAMES ON SYMBIAN OSsupported on a particular device.
The API is extendable, so new customeffects can be implemented.The API consists of an abstract effect class CAudioEffect, anobserver mixin class to receive effect-related events, and a numberof concrete effect implementations.The effects currently supported are bass boost (CBassBoost), equalizer (CAudioEqualizer), loudness control (CLoudness), reverb (CEnvironmentalReverb) and stereo widening (CStereoWidening).For equalizer, reverb and stereo widening effects, there are other APIsto access preset values for these effects on the device.
CAudioEqualizerUtility, CEnvironmentalReverbUtility and CStereoWideningUtility contain functions to access and modify the presetsstored on the device.4.6.2 3D Audio3D audio is an area that will become more important with the transitionfrom 2D to 3D graphics in mobile games. 3D audio support becomeseven more crucial to set the mood of a 3D game on a platform wheredevices have a limited display size by definition.Currently 3D audio support is included in the S60 3rd Edition SDKas a subset of the audio effects API.
Doppler (CDoppler) and distanceattenuation (CDistanceAttenuation) effects are two 3D audio effectsprovided by CAudioEffect-based classes in the SDK.There are two other abstract audio effect classes, CLocation andCOrientation. CLocation defines the methods to store and access a3D coordinate (both spherical and Cartesian coordinates are supported),and COrientation defines an orientation vector. The concrete classesderived from these two base classes define the location and the orientationof a listener (CListenerLocation, CListenerOrientation) and asound source (CSourceLocation, CSourceOrientation).When the game loop updates the positions of the objects in a 3D gameworld, it must update both the 3D graphics engine and the 3D audioengine together to keep the game world in an audio-visually consistentstate.
By using these classes, a game developer can set the 3D locationsand orientations of game objects (including the player) in the game world.Please refer to the S60 developer documentation for more informationon audio effects and 3D audio APIs.4.6.3 Beatnik MobileBAEMobileBAE is a commercial cross-platform audio engine developed byBeatnik Inc.
(www.beatnik.com). It started as a software wavetable synthesis engine for playing MIDI music, but has added support for playingsome digital audio formats and other advanced audio features as well.WHAT’S NEXT?153Many licensees licensed the Symbian OS port of this engine and used itin a number of Symbian smartphones to provide the implementation of theaudio features.
The implementation comes in the form of standard MMFplug-ins and is accessed through Symbian Client APIs. It also provides Cand C++ APIs for its native functionality, but this API is not exposed tothe third party applications. Sony Ericsson provided an extension to theirSDKs for some Symbian OS devices that used an older version of this API,but UIQ 3 devices use the new version.Please contact Beatnik Inc. directly for more information about thisengine.4.6.4 Helix DNA Client for Symbian OSHelix is a cross-platform digital media framework originally developedby RealNetworks and was subsequently released to the public as an opensource project. It consists of a media server, a client, a player application,a codec and format framework, and a content generation application,called ‘the producer.’ This framework can be used to stream and playvideo and audio data in various formats.Helix has a Symbian OS port of the DNA Client that is used to buildplayer applications compatible with various versions of Symbian OSincluding v9.1.
Multiple Symbian OS devices have been built that usedHelix technology for their own media playing features. The Helix clientand player projects are open source and are under active development.The current version supports audio codecs including MP3, AMR-NB,AAC+, RA8-LBR, RA10, RA-Voice, WMA9, WMV9 and Vorbis, as wellas various formats that can contain these types of data.The Helix source code is a good example of audio software.
It can beused in open source projects as well as being licensed for commercialprojects. It is also possible to use the Helix Client as a middleware libraryon devices where it is included. For more information on Helix, pleasevisit the Helix Community website at helixcommunity.org. You can findSymbian OS-related projects at symbian.helixcommunity.org.4.6.5 Khronos StandardsThe Khronos Group (www.khronos.org) is a member-funded industryconsortium focused on the creation of open standard APIs to enable theauthoring and playback of dynamic media on a wide variety of platformsand devices.
Symbian is a member of the group, as are a number ofSymbian licensees and partners.The Khronos standards for audio are OpenMAX AL and Open SLES (described below). As we go to press, the Khronos Group has justannounced that provisional versions of the OpenMAX AL 1.0 and OpenSL154ADDING AUDIO TO GAMES ON SYMBIAN OSES 1.0 specifications are available.4 Khronos expects the specificationsto be finalized by mid-2008 after integration of industry feedback andcompletion of tests to enable conformant implementations to use Khronostrademarks.Other Khronos standards of interest to mobile game developers, forexample for graphics or hardware interaction, are described in Chapter 7.OpenMAXOpenMAX AL is a media library portability standard. It defines a royaltyfree cross-platform API that provides portability for streaming mediacodecs and applications.This standard tries to reduce fragmentation of codecs, multimediaframeworks, and multimedia applications by providing three levels ofabstraction.
These three layers can be implemented together or independently from each other. Each software component supporting this standardhas to provide APIs that conform to the API specifications defined by thisstandard.The lowest layer of abstraction is the ‘development layer’ (or OpenMAX DL) that defines media primitives and concurrency constructs.Hardware media engines usually expose this layer. The intermediatelayer is the ‘integration layer’ (OpenMAX IL) which defines media component interfaces. This is an OS media framework layer. The highest levelof abstraction is the ‘application level’ (OpenMAX AL) which defineshigh-level playback and recording interface APIs.
This is the level usedby applications running on a mobile OS.Symbian is currently implementing support for OpenMAX IL compliance to make multimedia system integration easier for hardware devicecreators and to improve the audio adaptation framework.The most relevant API set for game audio developers is the applicationlevel OpenMAX AL.
It provides a standard high-level multimedia API foraudio playback and recording as well as video, image capture, and radiocontrol. It consists of a set of objects (for example, engine, devices, mediaobjects) and interfaces (for example, play, seek, record, audio encoder,radio, MIDI).
Although definition of the API is nearing completion, itis not anticipated to be available on Symbian smartphones in the nearfuture.4Khronos Group Releases OpenMAX AL 1.0 and OpenSL ES 1.0 Specifications forEmbedded Media and Audio Processing, October 2nd, 2007: www.khronos.org/news/press/releases/khronos group releases openmax al 10 and opensl es 10specifications for em.WHAT’S NEXT?155Open SL ESOpenSL ES is another standard from Khronos Group. It is designed to bethe sister standard of OpenGL ES in the audio area. It is designed to minimize fragmentation of audio APIs between proprietary implementationsand to provide a standard way to access audio hardware acceleration forthe application developers.
OpenSL ES is also a royalty-free open API andis portable between platforms, like OpenMAX. In fact, OpenMAX AL andOpenSL ES overlap in their support for audio playback, recording andMIDI functionality. A device can choose to support both OpenMAX ALand OpenSL ES together or just one of them.OpenSL ES supports a large set of features, but these features havebeen grouped into three ‘profiles’: phone, music and game. Any devicecan choose to support one or more of these profiles depending on itstarget market. OpenSL ES also supports vendor-specific extensions to addmore functionality to the standard feature set of a profile.OpenSL ES Game Profile supports hardware accelerated playback ofaudio files, advanced MIDI functionality (SP-MIDI, Mobile DLS, MobileXMF, MIDI messages), audio effects (equalizer, reverb, stereo widening,Doppler, pitch control), audio buffer queues, 3D audio, and more.OpenSL ES API is identical to OpenMAX AL, but adds support for moreobjects (for example, listener, player and 3D Groups) and interfaces (forexample, 3DLocation, 3DPlayer, 3DDoppler, 3DMacroscopic) for 3Daudio support.5Multiplayer GamesLeon Clarke (Ideaworks3D)Michael Coffey and Jo Stichbury5.1 IntroductionMobile phones are networked by nature – they are, after all, designed tobe used to communicate and engage with others – and are therefore wellsuited for multiplayer games.In this chapter, we will discuss aspects of game design on Symbian OSfor players who are local to one another (local multiplayer games usingshort link connections) and for players who are geographically distant(networked, or online, multiplayer games).