#include <revolution/pmic.h> // Sampling Frequency #define PMIC_FREQ_8KHZ 0x0000 #define PMIC_FREQ_11KHZ 0x0001 #define PMIC_FREQ_RESERVED 0x0002 #define PMIC_FREQ_16KHZ 0x0003 typedef void (*PMICCallback)(PMIC_ERR result, void* arg); PMIC_ERR PMICGetFreqAsync(u16* freq, PMICCallback cb, void* arg);
| freq | Location for storing the sampling frequency of the audio data received from the Wii Speak. |
|---|---|
| cb | Callback function that will send notification of the execution results of this function. |
| arg | Passed as the second argument of the callback function above. |
Returns one of the following.
| PMIC_ERR_OK | The function has been called normally. |
|---|---|
| PMIC_ERR_INVALID_ARGUMENTS | The correct argument was not passed. |
| PMIC_ERR_INVALID_STATE | The Wii Speak is not open. |
| PMIC_ERR_BUSY | Cannot register the command. Call the function again. |
| PMIC_ERR_FATAL | A fatal error has occurred. |
Asynchronously gets the sampling frequency of the audio data received from the Wii Speak.
This function stores the obtained sampling frequency at the address specified by the freq argument. The function stores PMIC_FREQ_8KHZ for a sampling frequency of 8000 Hz; PMIC_FREQ_11KHZ for a sampling frequency of 11,025 Hz; or PMIC_FREQ_16KHZ for a sampling frequency of 16,000 Hz. The default sampling frequency is PMIC_FREQ_16KHZ.
One of the following is passed to result, the callback function's first argument.
| PMIC_ERR_OK | The sampling frequency has been successfully obtained. |
|---|---|
| PMIC_ERR_NO_DEVICE | The Wii Speak has been unplugged. |
| PMIC_ERR_INVALID_STATE | The Wii Speak is not open. (Confirm that the Wii Speak cable is inserted in the USB port.) |
| PMIC_ERR_USB_ERROR | An error occurred in USB communications. Call the function again. |
| PMIC_ERR_FATAL | A fatal error has occurred. |
2008/10/23 Revised Description.
2008/04/18 Initial version.
CONFIDENTIAL