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 name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>WPADControlSpeaker</title> 10</head> 11 12<body> 13 14<h1>WPADControlSpeaker</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20<dd><pre><code>#include <revolution/wpad.h> 21 22#define WPAD_CHAN0 0 23#define WPAD_CHAN1 1 24#define WPAD_CHAN2 2 25#define WPAD_CHAN3 3 26 27#define WPAD_SPEAKER_OFF 0 28#define WPAD_SPEAKER_ON 1 29#define WPAD_SPEAKER_MUTE 2 30#define WPAD_SPEAKER_MUTE_OFF 3 31#define WPAD_SPEAKER_PLAY 4 32 33typedef void (*WPADCallback) ( s32 chan, s32 result ); 34 35s32 WPADControlSpeaker( s32 chan, u32 command, WPADCallback callback );</code></pre> 36 </dd> 37</dl> 38 39<h2>Arguments</h2> 40<TABLE border="1"> 41 <TBODY> 42 <TR> 43<TD><code><b><i>chan</i></b></code></TD> 44<TD>One of <code>WPAD_CHAN<i>n</i></code> values.</TD> 45 </TR> 46 <TR> 47<TD><CODE><b><i>pattern</i></b></CODE></TD> 48<TD><code>Set to one of WPAD_SPEAKER_OFF, WPAD_SPEAKER_ON, WPAD_SPEAKER_MUTE, WPAD_SPEAKER_MUTE_OFF, or WPAD_SPEAKER_PLAY.</code></TD> 49 </TR> 50 <TR> 51<TD><CODE><b><i>callback</i></b></CODE></TD> 52<TD>Callback function to notify about the result. Notification processing is omitted if NULL is specified.</TD> 53 </TR> 54 </TBODY> 55</TABLE> 56<h2>Return Values</h2> 57<p> 58Returns one of the following codes: 59</p> 60<p> 61<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> 62</P> 63<H2>Description</H2> 64<p> 65Controls the speaker of the Wii Remote Control on the specified channel. This function registers the speaker control command in the library. The WPAD library processes registered commands when other commands are not running. 66</p> 67<p> 68To output audio from the speaker on the Wii Remote, first start the speaker using the <code>WPAD_SPEAKER_ON</code> command. Next, audio can be output from the speaker using the <code>WPAD_SPEAKER_PLAY</code> command. Sending audio data using the <a href="./WPADSendStreamData.html"><code>WPADSendStreamData</code></a> at this time will cause audio to be output from the speaker of the Wii Remote. 69</p> 70 71<ul> 72<li>Commands</li> 73<p> 74The different commands are defined as follows. 75<table border="1"> 76<tr><td><code>WPAD_SPEAKER_OFF</code></td><td><code>Turns off the Wii Remote speaker.</code></td> 77<tr><td><code>WPAD_SPEAKER_ON</code></td><td><code>Turns on the Wii Remote speaker.</code></td> 78<tr><td><code>WPAD_SPEAKER_MUTE</code></td><td><code>Mutes the Wii Remote speaker.</code></td> 79<tr><td><code>WPAD_SPEAKER_MUTE_OFF</code></td><td><code>Unmutes the Wii Remote speaker.</code></td> 80<tr><td><code>WPAD_SPEAKER_PLAY</code></td><td><code>Allows audio data to be output from the Wii Remote speaker.</code></td> 81</table> 82</p> 83 84<li>Error Codes</li> 85<p> 86The return values have the following meanings: 87<table border="1"> 88<tr><td><code>WPAD_ERR_NONE</code></td><td><code>The WPAD library received a command.</code></td> 89<tr><td><code>WPAD_ERR_BUSY</code></td><td><code>The WPAD library was unable to receive a command.</code></td> 90<tr><td><code>WPAD_ERR_NO_CONTROLLER</code></td><td><code>The connection was broken.</code></td> 91</table> 92</p> 93 94<li>Callbacks</li> 95<p> 96In addition, if a callback function is set, the callback function returns the following error codes when the processing is complete. Their meanings are as follows: 97<table border="1"> 98<tr> 99<td><code>WPAD_ERR_NONE</code></td> 100<td>The command was processed normally.</td> 101</tr> 102<tr> 103<td><code>WPAD_ERR_TRANSFER</code></td> 104<td>A communications error prevented normal processing of the command.</td> 105</tr> 106<tr> 107<td><code>WPAD_ERR_NO_CONTROLLER</code></td> 108<td>The connection was broken.</td> 109</tr> 110</table> 111</p> 112</ul> 113 114<h2>See Also</h2> 115<p> 116<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br> <A href="./WPADIsSpeakerEnabled.html"><CODE>WPADIsSpeakerEnabled</CODE></A><br> <A href="./WPADSendStreamData.html"><CODE>WPADSendStreamData</CODE></A><br> 117</p> 118 119<H2>Revision History</H2> 120<P>08/15/2006 Initial version.</P> 121 122<hr> 123<P>CONFIDENTIAL</p> 124</BODY> 125</HTML>