update audio-io documentation
authorKimJeongYeon <jeongyeon.kim@samsung.com>
Wed, 8 Apr 2015 05:14:45 +0000 (14:14 +0900)
committerKimJeongYeon <jeongyeon.kim@samsung.com>
Wed, 8 Apr 2015 11:04:22 +0000 (20:04 +0900)
Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: I31707b0bd52718c0f51a03099954dc6b813216d1

org.tizen.guides/html/images/audio_in_interrupt_use_case.png [new file with mode: 0644]
org.tizen.guides/html/images/audio_input.png [deleted file]
org.tizen.guides/html/images/audio_input_interrupt_state.png [deleted file]
org.tizen.guides/html/images/audio_io_state_diagram.png [new file with mode: 0644]
org.tizen.guides/html/images/audio_out_interrupt_use_case.png [new file with mode: 0644]
org.tizen.guides/html/images/audio_output.png [deleted file]
org.tizen.guides/html/images/audio_output_interrupt_state.png [deleted file]
org.tizen.guides/html/native/multimedia/audio_io_n.htm
org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm

diff --git a/org.tizen.guides/html/images/audio_in_interrupt_use_case.png b/org.tizen.guides/html/images/audio_in_interrupt_use_case.png
new file mode 100644 (file)
index 0000000..dee5d3d
Binary files /dev/null and b/org.tizen.guides/html/images/audio_in_interrupt_use_case.png differ
diff --git a/org.tizen.guides/html/images/audio_input.png b/org.tizen.guides/html/images/audio_input.png
deleted file mode 100644 (file)
index b8614ac..0000000
Binary files a/org.tizen.guides/html/images/audio_input.png and /dev/null differ
diff --git a/org.tizen.guides/html/images/audio_input_interrupt_state.png b/org.tizen.guides/html/images/audio_input_interrupt_state.png
deleted file mode 100644 (file)
index 16d0d0c..0000000
Binary files a/org.tizen.guides/html/images/audio_input_interrupt_state.png and /dev/null differ
diff --git a/org.tizen.guides/html/images/audio_io_state_diagram.png b/org.tizen.guides/html/images/audio_io_state_diagram.png
new file mode 100644 (file)
index 0000000..446d0df
Binary files /dev/null and b/org.tizen.guides/html/images/audio_io_state_diagram.png differ
diff --git a/org.tizen.guides/html/images/audio_out_interrupt_use_case.png b/org.tizen.guides/html/images/audio_out_interrupt_use_case.png
new file mode 100644 (file)
index 0000000..eb6fce7
Binary files /dev/null and b/org.tizen.guides/html/images/audio_out_interrupt_use_case.png differ
diff --git a/org.tizen.guides/html/images/audio_output.png b/org.tizen.guides/html/images/audio_output.png
deleted file mode 100644 (file)
index c892df1..0000000
Binary files a/org.tizen.guides/html/images/audio_output.png and /dev/null differ
diff --git a/org.tizen.guides/html/images/audio_output_interrupt_state.png b/org.tizen.guides/html/images/audio_output_interrupt_state.png
deleted file mode 100644 (file)
index 48a369b..0000000
Binary files a/org.tizen.guides/html/images/audio_output_interrupt_state.png and /dev/null differ
index 1fd6f6f..ea8683d 100644 (file)
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
-    <meta http-equiv="X-UA-Compatible" content="IE=9" />
-    <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
-    <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
-    <script type="text/javascript" src="../../scripts/snippet.js"></script>
-    <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
-    <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
-    <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
-    <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+  <meta http-equiv="X-UA-Compatible" content="IE=9" />
+  <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
+  <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
+  <script type="text/javascript" src="../../scripts/snippet.js"></script>
+  <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
+  <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
+  <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
+  <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
   <title>Audio I/O</title>
- </head>
- <body onload="prettyPrint()" style="overflow: auto;">
+</head>
+<body onload="prettyPrint()" style="overflow: auto;">
 
- <div id="navigation">
-    <div id="profile">
-        <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
-    </div>
-
-    <div id="toc_border"><div id="toc">
-               <p class="toc-title">Content</p>
-               <ul class="toc">
-                       <li><a href="#record_pcm">Recording Uncompressed Audio</a></li>
-                       <li><a href="#play_pcm">Playing Uncompressed Audio</a></li>
-        </ul>
-        <p class="toc-title">Related Info</p>
-        <ul class="toc">
-            <li><a href="../../../../org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm">Audio I/O Tutorial</a></li>
-                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__TOOL__MODULE.html">Audio I/O API</a></li>
-        </ul>
-    </div></div>
+<div id="navigation">
+  <div id="profile">
+    <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
+  </div>
+  <div id="toc_border"><div id="toc">
+    <p class="toc-title">Content</p>
+    <ul class="toc">
+      <li><a href="#record_pcm">Recording Uncompressed Audio</a></li>
+      <li><a href="#play_pcm">Playing Uncompressed Audio</a></li>
+    </ul>
+    <p class="toc-title">Related Info</p>
+    <ul class="toc">
+      <li><a href="../../../../org.tizen.tutorials/html/native/multimedia/audio_io_tutorial_n.htm">Audio I/O Tutorial</a></li>
+      <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__TOOL__MODULE.html">Audio I/O API</a></li>
+    </ul>
+  </div></div>
 </div>
 
 <div id="container"><div id="contents"><div class="content">
 <h1>Audio I/O</h1>
 
- <p>Audio I/O enables your application to manage various media handles.</p> 
-  <p>The main features of the Audio I/O API include:</p> 
-  <ul> 
-       <li><a href="#record_pcm">Recording uncompressed audio</a>
-       <p>Enables you to capture uncompressed PCM data from audio device.</p></li>  
-   <li><a href="#play_pcm">Playing uncompressed audio</a>
-       <p>Enables you to create a multimedia application to play uncompressed PCM data.</p></li>  
-  </ul> 
-  
+  <p>Audio I/O enables your application to manage various media handles.</p>
+  <p>The main features of the Audio I/O API include:</p>
+  <ul>
+    <li><a href="#record_pcm">Recording uncompressed audio</a>
+      <p>Enables you to capture uncompressed PCM data from audio device.</p></li>
+    <li><a href="#play_pcm">Playing uncompressed audio</a>
+      <p>Enables you to create a multimedia application to play uncompressed PCM data.</p></li>
+  </ul>
+
+  <p>The following figure illustrates how Audio I/O state transitions generally.</p>
+  <p class="figure">Figure: State diagram of Audio I/O</p>
+  <p style="text-align:center;"><img src="../../images/audio_io_state_diagram.png" alt="Audio output states" /></p>
+
 <h2 id="record_pcm" name="record_pcm">Recording Uncompressed Audio</h2>
-<p>The Pulse Code Modulated (PCM) data contains non-compressed audio. The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IN__MODULE.html">Audio Input</a> API enables your application to record such data from a microphone type input device.</p> 
-  <p>Audio data is captured periodically, so to receive the audio PCM data from the input device, you must implement the audio input interface to notify the application of audio data events, such as the end of filling audio data.</p> 
-  <p>Before recording audio, you must define the following PCM data settings:</p> 
-  <ul> 
-   <li>Input device type: 
-    <ul class="indent"> 
-     <li>Microphone</li> 
-    </ul> </li> 
-   <li>Audio channels: 
-    <ul class="indent"> 
-     <li>Mono (1 channel)</li> 
-     <li>Stereo (2 channels)</li> 
-    </ul> </li> 
-   <li>Audio sample type: 
-    <ul class="indent"> 
-     <li>Unsigned 8-bit PCM</li> 
-     <li>Signed 16-bit little endian PCM</li> 
-    </ul> </li> 
-   <li>Audio sample rate: 
-   <ul class="indent"> 
-    <li>8000 ~ 48000 Hz</li> 
-   </ul></li> 
-  </ul> 
-  <p>To minimize the overhead of the audio input API, use the optimal channel type, sample type and sampling rate, which can be retrieved using the <span style="font-family: Courier New,Courier,monospace">audio_in_get_channel()</span>, <span style="font-family: Courier New,Courier,monospace">audio_in_get_sample_type()</span> and <span style="font-family: Courier New,Courier,monospace">audio_in_get_sample_rate()</span> functions, respectively.</p> 
+  <p>The Pulse Code Modulated (PCM) data contains non-compressed audio. The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IN__MODULE.html">Audio Input</a> API enables your application to record such data from a microphone type input device.</p>
+  <p>Audio data is captured periodically, so to receive the audio PCM data from the input device, you must implement the audio input interface to notify the application of audio data events, such as the end of filling audio data.</p>
+  <p>Before recording audio, you must define the following PCM data settings:</p>
+  <ul>
+    <li>Input device type:
+      <ul class="indent">
+        <li>Microphone</li>
+      </ul></li>
+    <li>Audio channels:
+      <ul class="indent">
+        <li>Mono (1 channel)</li>
+        <li>Stereo (2 channels)</li>
+      </ul></li>
+    <li>Audio sample type:
+      <ul class="indent">
+        <li>Unsigned 8-bit PCM</li>
+        <li>Signed 16-bit little endian PCM</li>
+      </ul></li>
+    <li>Audio sample rate:
+      <ul class="indent">
+        <li>8000 ~ 48000 Hz</li>
+      </ul></li>
+  </ul>
+  <p>To minimize the overhead of the audio input API, use the optimal channel type, sample type and sampling rate, which can be retrieved using the <span style="font-family: Courier New,Courier,monospace">audio_in_get_channel()</span>, <span style="font-family: Courier New,Courier,monospace">audio_in_get_sample_type()</span> and <span style="font-family: Courier New,Courier,monospace">audio_in_get_sample_rate()</span> functions, respectively.</p>
+
+  <p>The following figure illustrates how the state changes when the audio input is interrupted by the system. But this interrupt mechanism deprecated at Tizen 2.4, therefore it might be removed in next release.</p>
+  <p class="figure">Figure: Use case of audio input when interrupted by system</p>
+  <p style="text-align:center;"><img src="../../images/audio_in_interrupt_use_case.png" alt="Audio input states when interrupted by system" /></p>
 
-  <p>The following figures illustrate the general audio input states, and how the state changes when the audio input is interrupted by the system.</p> 
-  <p class="figure">Figure: Audio input states</p> 
-  <p style="text-align:center;"><img src="../../images/audio_input.png" alt="Audio input states" /></p> 
-  <p class="figure">Figure: Audio input states when interrupted by system</p> 
-  <p style="text-align:center;"><img src="../../images/audio_input_interrupt_state.png" alt="Audio input states when interrupted by system" /></p>
-  
   <h2 id="play_pcm" name="play_pcm">Playing Uncompressed Audio</h2>
-<p>The Pulse Code Modulated (PCM) data contains non-compressed audio. The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__OUT__MODULE.html">Audio Output</a> API enables your application to play such data using output devices.</p> 
-  <p>To play the audio PCM data, the application must call the <span style="font-family: Courier New,Courier,monospace">audio_out_create()</span> function to initialize the audio output handle.</p> 
-  <p>Before playing audio, your application must define the following PCM data settings:</p> 
-  <ul> 
-   <li>Audio channels: 
-    <ul class="indent"> 
-     <li>Mono (1 channel)</li> 
-     <li>Stereo (2 channels)</li> 
-    </ul> </li> 
-   <li>Audio sample type: 
-    <ul class="indent"> 
-     <li>Unsigned 8-bit PCM</li> 
-     <li>Signed 16-bit little endian PCM</li> 
-    </ul> </li> 
-   <li>Audio sample rate: 
-   <ul class="indent"> 
-    <li>8000 ~ 48000 Hz</li> 
-   </ul> </li>
-  </ul> 
-  
-  <p>The following figures illustrate the general audio output states, and how the state changes when the audio output is interrupted by the system.</p> 
-  <p class="figure">Figure: Audio output states</p> 
-  <p style="text-align:center;"><img src="../../images/audio_output.png" alt="Audio output states" /></p> 
-  <p class="figure">Figure: Audio output states when interrupted by system</p> 
-  <p style="text-align:center;"><img src="../../images/audio_output_interrupt_state.png" alt="Audio output states when interrupted by system" /></p> 
-  <h3 id="use" name="use">Using Audio Output</h3> 
-  <p>For supporting various low-end Tizen devices, the application must follow certain guidelines:</p> 
-  <ul> 
-   <li>Do not use multiple instances of the <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> excessively. 
-   <p>Using excessive multiple instances of the <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> has a negative effect on the application, because the audio data processing for re-sampling and mixing imposes a heavy burden on the system. </p> </li>
-   <li>Use device-preferred PCM format.
-   <ul> 
-    <li><p>To reduce the processing overhead, use the target device-preferred PCM format (for example, use 16-bit little endian, 44.1 kHz, stereo for Wave and Wave M).</p></li> 
-    <li><p>Using the preferred format reduces internal operations, such as converting audio samples from mono to stereo or re-sampling audio frequency to fit the target device&#39;s input sample rate.</p></li> 
-   </ul> </li> 
-   <li>Do not call the <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> functions too frequently. 
-   <ul> 
-    <li><p>The <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> functions require more processing time in the order of write &gt; prepare &gt; reset &gt; unprepare &gt; start &gt; stop. Therefore, keep the frequency of calling these functions to a minimum.</p></li> 
-   </ul> </li>
-   <li>Reduce event delay and remove glitches.
-   <ul> 
-    <li><p>The Audio Output API works recursively with events. The smaller the buffer size, the more often are events generated. If you use the Audio Output API with the smallest buffer and other resources (for example, a timer or sensor), the application is negatively influenced by the delay of the event. To prevent problems, set the write buffer size properly based on the other resources you need.</p></li> 
-    <li><p>To guarantee the working events of the Audio Output API independently, an instance of the Audio Output API needs to be created and worked on the event thread.</p></li> 
-   </ul> </li> 
-   <li>Use double-buffering.
-   <ul> 
-    <li><p>Use the double buffering mechanism to reduce latency. The mechanism works by first writing data twice before starting. After starting, whenever the listener (event) is called, you can write additional data.</p></li> 
-   </ul> </li> 
-  </ul>   
+  <p>The Pulse Code Modulated (PCM) data contains non-compressed audio. The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__OUT__MODULE.html">Audio Output</a> API enables your application to play such data using output devices.</p>
+  <p>To play the audio PCM data, the application must call the <span style="font-family: Courier New,Courier,monospace">audio_out_create_new()</span> function to initialize the audio output handle.</p>
+  <p>Before playing audio, your application must define the following PCM data settings:</p>
+  <ul>
+    <li>Audio channels:
+      <ul class="indent">
+        <li>Mono (1 channel)</li>
+        <li>Stereo (2 channels)</li>
+      </ul></li>
+    <li>Audio sample type:
+      <ul class="indent">
+        <li>Unsigned 8-bit PCM</li>
+        <li>Signed 16-bit little endian PCM</li>
+      </ul></li>
+    <li>Audio sample rate:
+      <ul class="indent">
+        <li>8000 ~ 48000 Hz</li>
+      </ul></li>
+  </ul>
+
+  <p>The following figure illustrates how the state changes when the audio output is interrupted by the system. But this interrupt mechanism deprecated at Tizen 2.4, therefore it might be removed in next release.</p>
+  <p class="figure">Figure: Use case of audio output when interrupted by system</p>
+  <p style="text-align:center;"><img src="../../images/audio_out_interrupt_use_case.png" alt="Audio output states when interrupted by system" /></p>
 
+  <h3 id="use" name="use">Using Audio Output</h3>
+  <p>For supporting various low-end Tizen devices, the application must follow certain guidelines:</p>
+  <ul>
+    <li>Do not use multiple instances of the <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> excessively.
+      <p>Using excessive multiple instances of the <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> has a negative effect on the application, because the audio data processing for re-sampling and mixing imposes a heavy burden on the system. </p> </li>
+    <li>Use device-preferred PCM format.
+      <ul>
+        <li><p>To reduce the processing overhead, use the target device-preferred PCM format (for example, use 16-bit little endian, 44.1 kHz, stereo for Wave and Wave M).</p></li>
+        <li><p>Using the preferred format reduces internal operations, such as converting audio samples from mono to stereo or re-sampling audio frequency to fit the target device&#39;s input sample rate.</p></li>
+      </ul></li>
+    <li>Do not call the <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> functions too frequently.
+      <ul>
+        <li><p>The <span style="font-family: Courier New,Courier,monospace">Audio_Out</span> functions require more processing time of prepare and unprepare operation in Tizen 2.4 or later. Therefore, keep the frequency of calling these functions to a minimum, or use pause and resume instead.</p></li>
+      </ul></li>
+    <li>Reduce event delay and remove glitches.
+      <ul>
+        <li><p>The Audio Output API works recursively with events. The smaller the buffer size, the more often are events generated. If you use the Audio Output API with the smallest buffer and other resources (for example, a timer or sensor), the application is negatively influenced by the delay of the event. To prevent problems, set the write buffer size properly based on the other resources you need.</p></li>
+        <li><p>To guarantee the working events of the Audio Output API independently, an instance of the Audio Output API needs to be created and worked on the event thread.</p></li>
+      </ul></li>
+    <li>Use double-buffering.
+      <ul>
+        <li><p>Use the double buffering mechanism to reduce latency. The mechanism works by first writing data twice before starting. After starting, whenever the listener (event) is called, you can write additional data.</p></li>
+      </ul></li>
+  </ul>
 
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
@@ -151,4 +150,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
index f75c22c..9095958 100644 (file)
@@ -1,46 +1,44 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <meta http-equiv="X-UA-Compatible" content="IE=9" />
-    <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
-    <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
-    <script type="text/javascript" src="../../scripts/snippet.js"></script>
-    <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
-    <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
-    <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
-    <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
-
-    <title>Audio I/O: Recording from the Audio Device and Playing Raw Audio Data</title>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+  <meta http-equiv="X-UA-Compatible" content="IE=9" />
+  <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
+  <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
+  <script type="text/javascript" src="../../scripts/snippet.js"></script>
+  <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
+  <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
+  <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
+  <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
+  <title>Audio I/O: Recording from the Audio Device and Playing Raw Audio Data</title>
 </head>
-
 <body onload="prettyPrint()" style="overflow: auto;">
 
 <div id="navigation">
-    <div id="profile">
-        <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
-    </div>
-    <div id="toc_border"><div id="toc">
-               <p class="toc-title">Content</p>
-               <ul class="toc">
-                       <li><a class="opensection" href="#init">Initializing the Audio Devices</a></li>
-                       <li><a class="opensection" href="#simple">Managing Simple Recording and Playback</a></li>
-                       <li><a class="opensection" href="#async">Managing Asynchronous Recording and Playback</a></li>
-                       <li><a class="opensection" href="#release">Releasing Resources</a></li>
-               </ul>
-        <p class="toc-title">Related Info</p>
-        <ul class="toc">
-            <li><a href="../../../../org.tizen.guides/html/native/multimedia/audio_io_n.htm">Audio I/O Guide</a></li>
-                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IO__MODULE.html">Audio I/O API</a></li>
-                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html">Sound Manager API</a></li>
-        </ul>
-    </div></div>
+  <div id="profile">
+    <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
+  </div>
+  <div id="toc_border"><div id="toc">
+    <p class="toc-title">Content</p>
+    <ul class="toc">
+      <li><a class="opensection" href="#init">Initializing the Audio Devices</a></li>
+      <li><a class="opensection" href="#simple">Managing Simple Recording and Playback</a></li>
+      <li><a class="opensection" href="#async">Managing Asynchronous Recording and Playback</a></li>
+      <li><a class="opensection" href="#release">Releasing Resources</a></li>
+    </ul>
+    <p class="toc-title">Related Info</p>
+    <ul class="toc">
+      <li><a href="../../../../org.tizen.guides/html/native/multimedia/audio_io_n.htm">Audio I/O Guide</a></li>
+      <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IO__MODULE.html">Audio I/O API</a></li>
+      <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html">Sound Manager API</a></li>
+    </ul>
+  </div></div>
 </div>
 
 <div id="container"><div id="contents"><div class="content">
 <h1>Audio I/O: Recording from the Audio Device and Playing Raw Audio Data</h1>
   <div class="cont"><div class="static-cont">
-  
+
 <p>This tutorial demonstrates how you can control audio input and output to record, and play an audio sample.</p>
 
 <h2>Warm-up</h2>
 </ul>
 
 <div class="devicespecs-util mt5 clfix">
-               <ul class="dutil">
-                       <li><a href="#" class="showA">Show All</a></li>
-                       <li class="none"><a href="#" class="hideA">Hide All</a></li>
-               </ul>
-       </div>
-
-               <ul class="devicespecifications">
-               <li>
-                       <div class="devicespec-tit">
- <h2 id="init" name="init" class="items-tit-h2">Initializing the Audio Devices</h2>
-<span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
-  </div>
-                       <div class="devicespec-con">
+  <ul class="dutil">
+    <li><a href="#" class="showA">Show All</a></li>
+    <li class="none"><a href="#" class="hideA">Hide All</a></li>
+  </ul>
+</div>
+
+<ul class="devicespecifications">
+<li>
+<div class="devicespec-tit">
 <h2 id="init" name="init" class="items-tit-h2">Initializing the Audio Devices</h2>
+  <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
+</div>
+<div class="devicespec-con">
 
 <p>To initialize the audio devices for use:</p>
-<ol><li>
-<p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IO__MODULE.html">Audio I/O</a> and <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html">Sound Manager</a> APIs, include the <span style="font-family: Courier New,Courier,monospace">&lt;audio_io.h&gt;</span> and <span style="font-family: Courier New,Courier,monospace">&lt;sound_manager.h&gt;</span> header files in your application:</p>
+<ol><li><p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IO__MODULE.html">Audio I/O</a> and <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html">Sound Manager</a> APIs, include the <span style="font-family: Courier New,Courier,monospace">&lt;audio_io.h&gt;</span> and <span style="font-family: Courier New,Courier,monospace">&lt;sound_manager.h&gt;</span> header files in your application:</p>
 <pre class="prettyprint">
 #include &lt;audio_io.h&gt;
 #include &lt;sound_manager.h&gt;
 </pre></li>
-<li><p>To initialize the audio input and output devices, use the <span style="font-family: Courier New,Courier,monospace">audio_in_create()</span> and <span style="font-family: Courier New,Courier,monospace">audio_out_create()</span> functions:</p>
+
+<li><p>To initialize the audio input and output handle, use the <span style="font-family: Courier New,Courier,monospace">audio_in_create()</span> and <span style="font-family: Courier New,Courier,monospace">audio_out_create_new()</span> functions:</p>
 <pre class="prettyprint">#define SAMPLE_RATE 44100
 
-audio_in_h input; // Declare audio input handle
+audio_in_h  input;  // Declare audio input handle
+audio_out_h output; // Declare audio output handle
 audio_io_error_e ret;
 
 // Audio input device initialization
 ret = audio_in_create(SAMPLE_RATE, AUDIO_CHANNEL_MONO, AUDIO_SAMPLE_TYPE_S16_LE, &amp;input);
 
-audio_out_h output; // Declare audio output handle
 // Audio output device initialization
-ret = audio_out_create(SAMPLE_RATE, AUDIO_CHANNEL_MONO, AUDIO_SAMPLE_TYPE_S16_LE, SOUND_TYPE_SYSTEM, &amp;output);
+// audio_out_create() function was deprecated at Tizen 2.4, use audio_out_create_new() function instead
+ret = audio_out_create_new(SAMPLE_RATE, AUDIO_CHANNEL_MONO, AUDIO_SAMPLE_TYPE_S16_LE, &amp;output);
 </pre>
 <p>The audio input and output devices support the channel types defined in the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IO__MODULE.html#ga4e07ead99d581a0a049e8ee632b858b4">audio_channel_e</a> enumeration, and the sample types defined in the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__AUDIO__IO__MODULE.html#ga1e66f976b2890f5fc2e9e6ec71af7536">audio_sample_type_e</a> enumeration. Set the same channel and sample type for both devices.</p>
 
-<p>The sound type is defined in the <span style="font-family: Courier New,Courier,monospace">&lt;sound_manager.h&gt;</span> header file. You can select the sound type according to the audio sample type.</p></li></ol>
-                       </div>
-               </li>                   
-               <li>
-                       <div class="devicespec-tit">
+<p>The sound type is defined in the <span style="font-family: Courier New,Courier,monospace">&lt;sound_manager.h&gt;</span> header file. You can select the sound type according to the audio sample type.</p></li>
+
+<li><p>To set configuration stream type properly, you should fill <span style="font-family: Courier New,Courier,monospace">sound_stream_info_h</span> structure and pass to audio input or output stream. If you skip this step, it will be running as <span style="font-family: Courier New,Courier,monospace">SOUND_STREAM_TYPE_MEDIA</span> sound type by default.
+<pre class="prettyprint">
+int ret;
+sound_stream_info_h g_stream_info_h = NULL;
+
+// Create stream info structure as media type
+ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, focus_callback, NULL, &g_stream_info_h);
+
+// Set stream info for audio input
+ret = audio_in_set_stream_info(input, g_stream_info_h);
+
+// Set stream info for audio output
+ret = audio_out_set_stream_info(output, g_stream_info_h);
+</pre>
+<p>Please refer <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__MEDIA__SOUND__MANAGER__MODULE.html">Sound Manager</a> APIs for more information about stream information.</p></li>
+
+<li><p>Optionally, you able to get event of state changed by registering user callback.
+<pre class="prettyprint">
+static void _audio_in_state_cb (audio_in_h handle, audio_io_state_e previous, audio_io_state_e current, bool by_policy, void *user_data)
+{
+   printf(">>> _audio_in_state_cb() : handle(%p), current(%d), previous(%d), by_policy(%d), user_data(%p)\n", handle, current, previous, by_policy, user_data);
+}
+
+static void _audio_out_state_cb (audio_in_h handle, audio_io_state_e previous, audio_io_state_e current, bool by_policy, void *user_data)
+{
+   printf(">>> _audio_out_state_cb() : handle(%p), current(%d), previous(%d), by_policy(%d), user_data(%p)\n", handle, current, previous, by_policy, user_data);
+}
+
+// Register state changed callback for audio input
+ret = audio_in_set_state_changed_cb(input, _audio_in_state_cb, NULL);
+
+// Register state changed callback for audio output
+ret = audio_out_set_state_changed_cb(output, _audio_out_state_cb, NULL);
+</pre>
+</p></li></ol>
+   </div>
+</li>
+<li>
+  <div class="devicespec-tit">
  <h2 id="simple" name="simple" class="items-tit-h2">Managing Simple Recording and Playback</h2>
 <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
   </div>
-                       <div class="devicespec-con"> 
+  <div class="devicespec-con">
 <h3 id="prepare" name="prepare">Preparing the Audio Input and Output Devices</h3>
 
 <p>To prepare the audio input device for recording audio, use the <span style="font-family: Courier New,Courier,monospace">audio_in_prepare()</span> function. To prepare the audio output device for playing the recorded audio, use the <span style="font-family: Courier New,Courier,monospace">audio_out_prepare()</span> function.</p>
@@ -244,14 +279,14 @@ void modify_sound()
 }</pre>
 
 <p>In this example, the volume is significantly increased. You can also make other modifications to the audio sample playback.</p></li></ol>
-                       </div>
-               </li>                                   
-               <li>
-                       <div class="devicespec-tit">
+  </div>
+</li>
+<li>
+  <div class="devicespec-tit">
  <h2 id="async" name="async" class="items-tit-h2">Managing Asynchronous Recording and Playback</h2>
 <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
   </div>
-                       <div class="devicespec-con"> 
+  <div class="devicespec-con">
 <p>To manage asynchronous recording and playback:</p>
 
 <ol><li>Create audio callback functions:
@@ -264,15 +299,15 @@ void _audio_io_stream_read_cb(audio_in_h handle, size_t nbytes, void *userdata)
 {
 &nbsp;&nbsp;&nbsp;const void * buffer = NULL;
 
-&nbsp;&nbsp;&nbsp;if (nbytes &gt; 0) 
+&nbsp;&nbsp;&nbsp;if (nbytes &gt; 0)
 &nbsp;&nbsp;&nbsp;{
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Retrieve buffer pointer from audio in buffer
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;audio_in_peek(handle, &amp;buffer, &amp;nbytes);
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (fp_w) 
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (fp_w)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fwrite(buffer, sizeof(char), nbytes, fp_w);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
-               
+
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Remove audio in data from actual stream buffer
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;audio_in_drop(handle);
 &nbsp;&nbsp;&nbsp;}
@@ -289,7 +324,7 @@ void _audio_io_stream_write_cb(audio_out_h handle, size_t nbytes, void *userdata
 &nbsp;&nbsp;&nbsp;char* buffer = NULL;
 &nbsp;&nbsp;&nbsp;int ret = 0;
 
-&nbsp;&nbsp;&nbsp;if (nbytes &gt; 0) 
+&nbsp;&nbsp;&nbsp;if (nbytes &gt; 0)
 &nbsp;&nbsp;&nbsp;{
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buffer = malloc (nbytes);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memset(buffer, 0, nbytes);
@@ -297,7 +332,7 @@ void _audio_io_stream_write_cb(audio_out_h handle, size_t nbytes, void *userdata
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret = fread(buffer, 1, nbytes, fp_r);
 
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret = audio_out_write(handle, buffer, nbytes);
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(ret &gt; AUDIO_IO_ERROR_NONE) 
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(ret &gt; AUDIO_IO_ERROR_NONE)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Error handling
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
@@ -327,14 +362,14 @@ ret = audio_in_prepare(input);
 // Audio output prepare
 ret = audio_out_prepare(output);
 </pre></li></ol>
-                       </div>
-               </li>   
-               <li>
-                       <div class="devicespec-tit">
+  </div>
+</li>
+<li>
+  <div class="devicespec-tit">
  <h2 id="release" name="release" class="items-tit-h2">Releasing Resources</h2>
 <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
   </div>
-                       <div class="devicespec-con"> 
+  <div class="devicespec-con">
 <p>To destroy the audio handles and release the allocated resources after you have finished working with the audio input and output devices:</p>
 
 <ol><li><p>Release the memory allocated to the buffer using the <span style="font-family: Courier New,Courier,monospace">free()</span> function:</p>
@@ -352,6 +387,9 @@ ret = audio_out_unprepare(output);
 ret = audio_out_destroy(output);
 </pre></li>
 
+<li><p>If you did create stream information structure before recording and playback, need to destroy it together using <span style="font-family: Courier New,Courier,monospace">sound_manager_destroy_stream_information()</span> function:</p>
+<pre class="prettyprint">ret = sound_manager_destroy_stream_information(g_stream_info_h);</pre></li>
+
 <li><p>Close opened file using the <span style="font-family: Courier New,Courier,monospace">fclose()</span> function:</p>
 
 <pre class="prettyprint">fclose(fp_w);
@@ -359,10 +397,10 @@ fp_w = NULL;
 
 fclose(fp_r);
 fp_r = NULL;</pre></li></ol>
-                       </div>
-               </li>                   
-       </ul>   
-</div>                         
+  </div>
+</li>
+</ul>
+</div>
 </div>
 
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>