#include <revolution/pmic.h>
// Working area size on MEM2 that the PMIC library uses
#define PMIC_MEM2_WORK 17408 // 17 KB
#define PMIC_READ_BUFFER_MSEC (48) // 48 msec
#define PMIC_READ_BUFFER_SAMPLES (PMIC_READ_BUFFER_MSEC * 16) // @16 kHz, @mono
#define PMIC_READ_BUFFER_SIZE (PMIC_READ_BUFFER_SAMPLES * sizeof(s16)) // @s16
PMIC_ERR PMICInit(void* mem2);
| mem2 | Starting address of the work region allocated in MEM2 for the PMIC library. (The size of this region is PMIC_MEM2_WORK bytes.) |
|---|
Returns one of the following.
| PMIC_ERR_OK | The library has been initialized normally. |
|---|---|
| PMIC_ERR_INVALID_ARGUMENTS | The correct argument was not passed. |
| PMIC_ERR_BUSY | The state is in transition. Call the function again. |
| PMIC_ERR_FATAL | A fatal error has occurred. |
Initializes the PMIC library. This function must be called once before using any other PMIC functions.
When this function initializes the PMIC library, the library allocates a buffer for 48 ms of audio data obtained from the Wii Speak (or approximately 70 ms at 16 kHz or 11 kHz, or 96 ms at 8 kHz) in the region specified by the mem2 argument. Applications must then call the PMICRead function at intervals less than 48 ms (at 16 kHz) to keep audio data from being overwritten in this buffer.
Initialize the library with the PMICInitEx function if you want to increase the interval for calling the PMICRead function to longer than 48 ms.
After calling this function, be sure to call the PMICProbe function once before calling the PMICOpen(Async) functions.
PMICInitEx
PMICProbe
PMICOpen
PMICOpenAsync
PMICRead
2009/06/01 Added description related to calling PMICProbe.
2008/10/21 Changed the size of work memory.
2008/09/25 Changed the size of work memory.
2008/03/04 Changed the function reference format.
2008/01/25 Initial version.
CONFIDENTIAL