Header Sep

Symbian OS Tips, Tricks & Code

Score
Login to rate page

August 2006

Add audio playing functionality to UIQ 3 apps using CMMFDevSound class

This UIQ 3 example is designed to show how one can add audio file playing functionality to an application for the UIQ 3-based P990, M600 and W950 mobile phones. There are two main parts to the application:

  • a user interface for choosing audio files and proper audio settings (view class)
  • an audio engine using CMMFDevSound class

This application is created in a similar way to the "Streaming audio in UIQ 3 applications" Tip, Trick & Code article from July 2006.

Download example application>>

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

The audio engine built for this application (CMyAudioClientEngine) sets the proper settings and handles playing the audio.

The View class handles creating and displaying the settings to the user. The user can choose to:

  • Set 'default folder'. This is the folder where the application starts looking for audio files.
  • Set audio file. Dialog is started in the 'default folder' and the user can navigate from there to the preferred audio file.
  • Choose codec from a list.
  • Set application volume. This is dependent on the main volume level of the phone.
  • Start and stop audio play using buttons.

Application interface. Choose codecs. Navigate to choose audio file.

For selecting audio source folders and files, 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 a '#define' macro in resources which reuses the required code.


To build this example application for the P990, M600 and W950 mobile phones, use the following commands:

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

For more information, check out the UIQ 3.0 SDK here>>

Score
Login to rate page