Symbian3/SDK/Source/GUID-21D0D9D5-B57F-5F16-A2AF-17BC00DC1B15-GENID-1-6-1-17-1-1-4-1-4-1.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-21D0D9D5-B57F-5F16-A2AF-17BC00DC1B15-GENID-1-6-1-17-1-1-4-1-4-1" xml:lang="en"><title>AudioClientEx:
Multimedia audio example code</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<section><title>Description</title> <p> <filepath>AudioClientEx</filepath> demonstrates
the use of the Multimedia Framework's client audio interfaces. It allows the
user to: </p> <ul>
<li id="GUID-2C0B7945-13C3-552A-BE5E-094C3D3528B5-GENID-1-6-1-17-1-1-4-1-4-1-2-1-3-1"><p>choose a tone to play </p> </li>
<li id="GUID-EBD81D06-4A94-5795-B037-86C0A8140E61-GENID-1-6-1-17-1-1-4-1-4-1-2-1-3-2"><p>choose a file to play </p> </li>
<li id="GUID-177DF4AF-2671-54E0-AE43-88B13466BA84-GENID-1-6-1-17-1-1-4-1-4-1-2-1-3-3"><p>choose a file to convert
to another format </p> </li>
<li id="GUID-F12B8E97-ABBE-5E87-B859-5BFEA2AACF8C-GENID-1-6-1-17-1-1-4-1-4-1-2-1-3-4"><p>record to a file </p> </li>
<li id="GUID-2F274F02-1A18-5BF8-93E2-7383062A8BE9-GENID-1-6-1-17-1-1-4-1-4-1-2-1-3-5"><p>play a streaming source </p> </li>
<li id="GUID-A9F3BBF1-D06B-5CEA-8695-C2EDDBBCC1E1-GENID-1-6-1-17-1-1-4-1-4-1-2-1-3-6"><p>set the volume </p> </li>
</ul> <p>The Multimedia Framework APIs are called by the example's engine
class, <codeph>CMediaClientEngine</codeph>. This also implements the various
callback interfaces required by the APIs in order to report progress and error
conditions. Each of the play options (tone, file, stream) is handled by a
separate overload of the <codeph>PlayL()</codeph> function. Recording is started
through <codeph>RecordL()</codeph>. The current operation can always be terminated
through <codeph>Stop()</codeph>. </p> <p>The engine is driven through the
example's UI class <codeph>CMediaClientAppUi</codeph>. The engine notifies
the UI of significant events by calling its <codeph>HandleEngineState()</codeph> function.
The UI uses this to update text describing the current activity appropriately. </p> <p>Interaction
between the UI and engine is in most cases simple. Streaming however is more
complex. To simulate a streaming data source (e.g. an audio stream being received
over the Internet), the UI creates a timer object that periodically passes
slices of data (read from a file) to the engine. </p> </section>
<section id="GUID-7FDD920B-524F-5EF4-B87F-EB78A83FB789-GENID-1-6-1-17-1-1-4-1-4-1-2-2"><title>Download</title> <p>Click
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-90b3674d-2812-418b-8f00-74916bca2b55.zip" scope="external"> AudioClient.zip file</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-90b3674d-2812-418b-8f00-74916bca2b55.html" scope="peer">browse </xref>to view the example code. </p> </section>
<section><title>Class summary</title><p> <xref href="GUID-D728A286-A202-3915-9643-8FD70646F78A.dita"><apiname>CMdaAudioToneUtility </apiname></xref>  <xref href="GUID-778D24B5-A68E-3C91-B66A-69007FBA4791.dita"><apiname>CMdaAudioPlayerUtility </apiname></xref> <xref href="GUID-29FB1DE6-D00C-3E6B-A8AA-476FAFD7F26C.dita"><apiname>CMdaAudioRecorderUtility </apiname></xref> <xref href="GUID-B87C8F92-9737-3636-9800-BA267A1DCA6D.dita"><apiname>CMdaAudioOutputStream </apiname></xref>  <xref href="GUID-810D29DA-8332-3E63-8A63-5B8A04EC9688.dita"><apiname>CMdaAudioConvertUtility </apiname></xref>  <xref href="GUID-CF54F882-E290-3C68-9352-79C6B7303FDF.dita"><apiname>TMdaAudioDataSettings </apiname></xref>  <xref href="GUID-9DFD6F28-AFA9-3819-8EEC-EC69BD4BC35A.dita"><apiname>RMetaDataArray </apiname></xref> <xref href="GUID-18E540DE-8CAC-390D-8A0B-1C24D3D30693.dita"><apiname>TFormatOptions TRecordFormatOptions </apiname></xref> </p></section>
<section><title>Usage</title> <p>Commands are given to the example through
its Actions and Options menus. For tone play, the user is asked to specify
a pitch and duration; for file play, conversion, and recording, the user is
asked to specify a file, and any available format options. The audio data
source for streaming in the example is a preset file, so this command does
not require further input. </p> <p>A sample file, <filepath>note.wav</filepath> is
put by the example on the emulator's C drive for file play. </p> </section>
</conbody></concept>