1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<title>PMICSetFreqAsync</title>
9</head>
10
11<body>
12
13<h1>PMICSetFreqAsync</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/pmic.h&gt;
18
19// Sampling frequency
20#define PMIC_FREQ_8KHZ               0x0000
21#define PMIC_FREQ_11KHZ              0x0001
22#define PMIC_FREQ_RESERVED           0x0002
23#define PMIC_FREQ_16KHZ              0x0003
24
25typedef void (*PMICCallback)(PMIC_ERR result, void* arg);
26
27PMIC_ERR PMICSetFreqAsync(u16 freq, PMICCallback cb, void* arg);
28</pre></dd></dl>
29
30<h2>Arguments</h2>
31<TABLE class="arguments" border="1" >
32  <tr>
33<th>freq</th>
34<td>Sampling frequency of the audio data received from the Wii Speak.</td>
35  </tr>
36  <tr>
37<th>cb</th>
38<td>Callback function that will send notification of the execution results of this function.</td>
39  </tr>
40  <tr>
41<th>arg</th>
42<td>Passed as the second argument of the callback function above.</td>
43  </tr>
44</TABLE>
45
46<h2>Return Values</h2>
47<p>
48Returns one of the following.
49</p>
50
51<TABLE class="arguments" border="1">
52  <tr>
53<th><CODE>PMIC_ERR_OK</CODE></th>
54<td>The function has been called normally.</td>
55  </tr>
56  <tr>
57<th><CODE>PMIC_ERR_INVALID_ARGUMENTS</CODE></th>
58<td>The correct argument was not passed.</td>
59  </tr>
60  <tr>
61<th><CODE>PMIC_ERR_INVALID_STATE</CODE></th>
62<td>The Wii Speak is not open.</td>
63  </tr>
64  <tr>
65<th><CODE>PMIC_ERR_BUSY</CODE></th>
66<td>Cannot register the command. Call the function again.</td>
67  </tr>
68  <tr>
69<th><CODE>PMIC_ERR_FATAL</CODE></th>
70<td>A fatal error has occurred.</td>
71  </tr>
72</TABLE>
73
74<H2>Description</H2>
75<p>Asynchronously sets the sampling frequency for the audio data received from the Wii Speak.</p>
76
77<p>The sampling frequency is specified in the <SPAN class="argument">freq</SPAN> argument. The value can be set to 8000 Hz; 11,025 Hz; or 16,000 Hz. Specify <code>PMIC_FREQ_8KHZ</code> for a sampling frequency of 8000 Hz; <code>PMIC_FREQ_11KHZ</code> for a frequency of 11,025 Hz; or <code>PMIC_FREQ_16KHZ</code> for a frequency of 16,000 Hz. The Wii Speak default sampling frequency is 16,000 Hz.</p>
78
79<p><strong>Note: If acoustic signal processing (the echo canceler) is enabled, the effective band for audio data received from the Wii Speak is narrowed to a range equivalent to the 11,025-Hz sampling rate, even if the Wii Speak sampling frequency is set to 16,000 Hz. The entire frequency band for 16,000-Hz sampling is enabled when you disable acoustic signal processing by calling the <code>PMICSetSpState(Async)</code> function. Note that when you are sampling at 11,025 Hz or 8000 Hz, the entire frequency band of each is enabled regardless of whether acoustic signal processing is enabled or disabled.</strong></p>
80
81<p>This function can be called when the Wii Speak is in the STOP state.</p>
82
83<p>One of the following is passed to <SPAN class="argument">result</SPAN>, the callback function's first argument.</p>
84
85<TABLE class="arguments" border="1" >
86  <tr>
87<th><CODE>PMIC_ERR_OK</CODE></th>
88<td>The sampling frequency has been set successfully.</td>
89  </tr>
90  <tr>
91<th><CODE>PMIC_ERR_NO_DEVICE</CODE></th>
92<td>The Wii Speak has been unplugged.</td>
93  </tr>
94  <tr>
95<th><CODE>PMIC_ERR_INVALID_STATE</CODE></th>
96<td>The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.)</td>
97  </tr>
98  <tr>
99<th><CODE>PMIC_ERR_USB_ERROR</CODE></th>
100<td>An error occurred in USB communications. Call the function again.</td>
101  </tr>
102  <tr>
103<th><CODE>PMIC_ERR_FATAL</CODE></th>
104<td>A fatal error has occurred.</td>
105  </tr>
106</TABLE>
107
108<H2>See Also</H2>
109<p>
110<a href="PMICSetSpStateAsync.html"><CODE>PMICSetEcResetAsync</CODE></a><BR> <a href="PMICSetSpState.html"><CODE>PMICSetEcReset</CODE></a>
111</p>
112
113<H2>Revision History</H2>
114<p>
1152009/06/11 Revised the cautions related to the enabled band.<br>2009/06/09 Revised the cautions related to the enabled band.<br>2009/04/10 Revised the cautions relating to the sampling frequency.<br>2008/10/24 Revised <B>Description</B>.<br>2008/07/04 Revised the description of <code>PMIC_ERR_INVALID_STATE</code>.<br>2008/04/18 Initial version.
116</p>
117
118<hr><p>CONFIDENTIAL</p></body>
119
120</html>
121