Header Sep

Symbian OS Tips, Tricks & Code

My Rating Score
Login to rate page

July 2006

Streaming audio in UIQ 3 applications

This UIQ 3 example application shows how to stream audio files in other applications. Suitable for the P990, M600 and W950 UIQ 3-based phones, this application uses the CMdaAudioOutputStream class, system dialogs and generic building blocks from resources.

This example has two main parts:

  • a user interface for choosing audio files and proper audio settings
  • an audio engine

Download example application>>

Audio is played using the CMdaAudioOutputStream class. There are few key things worth mentioning when using it. The user has to set the correct audio settings for a chosen audio file. If this is not done, an error might occur and audio will be played incorrectly (i.e. at the wrong speed) or there will be no audio at all.

An audio engine built from this example application consists of two main parts:

  • class CMyAudioStreamSource, providing audio stream source. It gets data in slices from a file as soon as the stream player is ready for them. This class inherits from the CActive class.
  • class CMyAudioClientEngine, setting the correct settings and handles audio playing.

The AppUi class is notified on changes in audio states and handles this properly (i.e. by passing event information to be displayed by view class to the user).

 

To be able to play audio, the user has to be able to set some key features:

  • audio file to be used
  • select folder where audio files are located
  • a codec type
  • audio type (mono/stereo)
  • audio rate
  • played stream volume

For choosing audio source folder and file, there are two system classes used:

  • CQikSelectFolderDlg
  • CQikSelectFileDlg

This application uses the generic building block: CQikGenericBuildingBlock (QIK_GENERIC_BUILDING_BLOCK, EQikCtGenericBuildingBlock) for inserting and managing used controls. Since the same column definition is used couple of times, use '#define' macro in resources which will reuse the required code.

An additional functionality removes unwanted commands normally added automatically by the system (in DynInitOrDeleteCommandL function).

This application works in portrait and landscape modes on the Sony Ericsson P990, M600 and W950 UIQ 3-based phones and to build this project, use the following commands:

$ bldmake bldfiles
$ abld build gcce urel
$ makesis MyPlay_gcce.pkg


For more information, see the UIQ 3 SDK documentation at:
UIQ 3 SDK / UIQ Developer Library / UIQ Migration Quick Guide / 5 UI Configurations

Also see the P990 Developers' Guidelines>>
 

My Rating Score
Login to rate page