|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-21D0D9D5-B57F-5F16-A2AF-17BC00DC1B15-GENID-1-6-1-17-1-1-4-1-4-1" xml:lang="en"><title>AudioClientEx: |
|
13 Multimedia audio example code</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section><title>Description</title> <p> <filepath>AudioClientEx</filepath> demonstrates |
|
15 the use of the Multimedia Framework's client audio interfaces. It allows the |
|
16 user to: </p> <ul> |
|
17 <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> |
|
18 <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> |
|
19 <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 |
|
20 to another format </p> </li> |
|
21 <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> |
|
22 <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> |
|
23 <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> |
|
24 </ul> <p>The Multimedia Framework APIs are called by the example's engine |
|
25 class, <codeph>CMediaClientEngine</codeph>. This also implements the various |
|
26 callback interfaces required by the APIs in order to report progress and error |
|
27 conditions. Each of the play options (tone, file, stream) is handled by a |
|
28 separate overload of the <codeph>PlayL()</codeph> function. Recording is started |
|
29 through <codeph>RecordL()</codeph>. The current operation can always be terminated |
|
30 through <codeph>Stop()</codeph>. </p> <p>The engine is driven through the |
|
31 example's UI class <codeph>CMediaClientAppUi</codeph>. The engine notifies |
|
32 the UI of significant events by calling its <codeph>HandleEngineState()</codeph> function. |
|
33 The UI uses this to update text describing the current activity appropriately. </p> <p>Interaction |
|
34 between the UI and engine is in most cases simple. Streaming however is more |
|
35 complex. To simulate a streaming data source (e.g. an audio stream being received |
|
36 over the Internet), the UI creates a timer object that periodically passes |
|
37 slices of data (read from a file) to the engine. </p> </section> |
|
38 <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 |
|
39 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> |
|
40 <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> |
|
41 <section><title>Usage</title> <p>Commands are given to the example through |
|
42 its Actions and Options menus. For tone play, the user is asked to specify |
|
43 a pitch and duration; for file play, conversion, and recording, the user is |
|
44 asked to specify a file, and any available format options. The audio data |
|
45 source for streaming in the example is a preset file, so this command does |
|
46 not require further input. </p> <p>A sample file, <filepath>note.wav</filepath> is |
|
47 put by the example on the emulator's C drive for file play. </p> </section> |
|
48 </conbody></concept> |