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>PMICSetFreq</title>
9</head>
10
11<body>
12
13<h1>PMICSetFreq</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
25PMIC_ERR PMICSetFreq(u16 freq);
26</pre></dd></dl>
27
28<h2>Arguments</h2>
29<TABLE class="arguments" border="1" >
30  <tr>
31<th>freq</th>
32<td>Sampling frequency of the audio data received from the Wii Speak.</td>
33  </tr>
34</TABLE>
35
36<h2>Return Values</h2>
37<p>
38Returns one of the following.
39</p>
40
41<TABLE class="arguments" border="1">
42  <tr>
43<th><CODE>PMIC_ERR_OK</CODE></th>
44<td>The sampling frequency has been set successfully.</td>
45  </tr>
46  <tr>
47<th><CODE>PMIC_ERR_INVALID_ARGUMENTS</CODE></th>
48<td>The correct argument was not passed.</td>
49  </tr>
50  <tr>
51<th><CODE>PMIC_ERR_NO_DEVICE</CODE></th>
52<td>The Wii Speak has been unplugged.</td>
53  </tr>
54  <tr>
55<th><CODE>PMIC_ERR_INVALID_STATE</CODE></th>
56<td>The Wii Speak is not open.</td>
57  </tr>
58  <tr>
59<th><CODE>PMIC_ERR_BUSY</CODE></th>
60<td>Cannot register the command. Call the function again.</td>
61  </tr>
62  <tr>
63<th><CODE>PMIC_ERR_USB_ERROR</CODE></th>
64<td>An error occurred in USB communications. Call the function again.</td>
65  </tr>
66  <tr>
67<th><CODE>PMIC_ERR_FATAL</CODE></th>
68<td>A fatal error has occurred.</td>
69  </tr>
70</TABLE>
71
72<H2>Description</H2>
73<p>Synchronously sets the sampling frequency for the audio data received from the Wii Speak.</p>
74
75<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>
76
77<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>
78
79<p>This function can be called when the Wii Speak is in the STOP state.</p>
80
81<H2>See Also</H2>
82<p>
83<a href="PMICSetSpStateAsync.html"><CODE>PMICSetEcResetAsync</CODE></a><BR> <a href="PMICSetSpState.html"><CODE>PMICSetEcReset</CODE></a>
84</p>
85
86<H2>Revision History</H2>
87<p>
882009/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 Added <B>Return Values</B>.<br>2008/07/04 Revised the description of <code>PMIC_ERR_INVALID_STATE</code>.<br>2008/04/18 Initial version.
89</p>
90
91<hr><p>CONFIDENTIAL</p></body>
92
93</html>
94