1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>mic2wav</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9<STYLE type="text/css">
10<!--
11.sample_source{
12  background-color : #e8e8e8;
13}
14H3{
15  color : teal;
16}
17.command_list{
18  margin-bottom : 16pt;
19}
20.command_desc{
21  }
22.command_item{
23  margin-top : 16pt;
24  background-color : #e8e8e8;
25}
26.blockquoted_table {
27  border : 1px;
28  width : 80%;
29}
30TD,TH{
31  border-color  : #c0d8d8;
32  padding       : 1pt 4pt 1pt 4pt;
33  border-width  : 1px;
34  border-style  : solid;
35}
36-->
37</STYLE>
38</HEAD>
39<BODY>
40<H1 align="left">mic2wav <img src="../image/NTR.gif" align="middle"><img src="../image/TWL.gif" align="middle"></H1>
41<H2>Description</H2>
42<P><code>mic2wav</code> is a tool that takes text format recording data obtained by running the microphone sample demos <A href="../demos/spi/spidemos.html">mic-2</A > and <A href="../demos/spi/spidemos.html">mic-4</A>, then converts them into .wav audio files in PCM format.</P>
43
44<H2>Using the Tool</H2>
45<H3>Start Command</H3>
46<P><CODE>% mic2wav TEXTFILE [OUTPUT_DIRECTORY]</CODE></P>
47<P>  This tool interprets the text data that is written in the file specified in TEXTFILE. It outputs the individual data samples as .wav files to the directory specified in OUTPUT_DIRECTORY. OUTPUT_DIRECTORY can be omitted. When omitting it, it will be generated at the same location as the file specified in TEXTFILE.</P>
48<P>The file names are numbers generated in ascending order 00000000.wav, 00000001.wav, ... When there is an existing file with the same name, it is written over.</P>
49<H3>Audio Text Data Formats</H3>
50<P><code>mic2wav</code> interprets the text data based on the following formats.</P>
51<P>All formats are interpreted on a per-line basis, with decisions based on the text strings at the head of the row.</P>
52<P></P>
53<TABLE border="1">
54  <TBODY>
55    <TR>
56<TH>Format</TH>
57<TH>Description</TH>
58<TH>Details</TH>
59    </TR>
60    <TR>
61<TD>$rate=<em>RATE</em></TD>
62<TD>Specification of Frequency</TD>
63<TD>Sampling frequencies in Hz units are specified in the <I><FONT color="#400000">RATE</FONT></I> section as integers.
64      </TD>
65    </TR>
66    <TR>
67<TD>$bits=<em>BITS</em></TD>
68<TD>Specification of Bit Count</TD>
69<TD>The quantization bit rate is specified in integers in the BITS section. The following values can be accommodated as .wav file PCM formats. <BR>8 bit<BR>16 bit<BR><BR>The microphone demos, <a href="../demos/spi/spidemos.html">mic-2</a> and <A href="../demos/spi/spidemos.html">mic-4</A>, support the recording of all of these values.
70      </TD>
71    </TR>
72    <TR>
73<TD>$end</TD>
74<TD>Specification of Data Termination</TD>
75<TD>The series of settings and sampling data so far will be output individual .wav files. The output files will be generated automatically according to the rules described above. After being output, the sampling data is all discarded and the system returns to the pre-input analytical state.
76      </TD>
77    </TR>
78    <TR>
79<TD>|<I><FONT color="#400000">DATA</FONT></I>,<I><FONT color="#400000">DATA</FONT></I>, ...</TD>
80<TD>Specification of Sampling</TD>
81<TD>Based on the settings, the DATA section is read in as sampling data  in unsigned, 16-bit whole numbers. If the quantization bit rate is 8 bits, then the data will be 00 ~ FF, if 16 bits, then 0000 ~FFFF. If the number of digits do not match exactly, they will be simply ignored. The microphone sample demos <a href="../demos/spi/spidemos.html">mic-2</a> and <A href="../demos/spi/spidemos.html">mic-4</A> will output 16 samples per line. XXXIf this format appears more than once, the subsequent <em><strong><code>$rate</code></strong></em> and <em><strong><code>$bits</code></strong></em> setting changes will be ignored unless data end has been specified using <CODE>$end</CODE>.
82      </TD>
83    </TR>
84    <TR>
85      <TD># ...</TD>
86<TD>Comments</TD>
87<TD>This is interpreted as an explicit comment row and it reads it and discards it without doing anything.
88      </TD>
89    </TR>
90    <TR>
91
92<TD>Other</TD>
93<TD>Illegal Formats</TD>
94<TD>Unrecognizable, illegal formats are read and discarded without doing anything.
95      </TD>
96    </TR>
97  </TBODY>
98</TABLE>
99<P>Based on the above formats, the text data output by the microphone sample demos <A href="../demos/spi/spidemos.html">mic-2</A> and <A href="../demos/spi/spidemos.html">mic-4</A> is batch-generated as audio files. For the text, text strings need to be copied from the debug log output window and prepared as arbitrary text files.
100</P>
101<H2>Location</H2>
102<P><CODE>$TwlSDK/tools/bin/mic2wav.exe</CODE></P>
103<H2>See Also</H2>
104<P><CODE><A href="../demos/spi/spidemos.html">Microphone Sample Demos (mic-2 / mic-4)</A></CODE></P>
105<H2>Revision History</H2>
106<P>
1072008/09/11 Removed a description of the fact that use under the TWL environment is not recommended.<BR> 2008/07/18 Corrected the descriptoin of the sampling rate.<BR> 2004/08/17 Standardized the notation used for IS-NITRO-EMULATOR.<BR> 2004/06/18 Initial version.</P><BR>
108<hr><p>CONFIDENTIAL</p></body>
109</HTML>