PMICSetFreq

Syntax

#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

PMIC_ERR PMICSetFreq(u16 freq);

Arguments

freq Sampling frequency of the audio data received from the Wii Speak.

Return Values

Returns one of the following.

PMIC_ERR_OK The sampling frequency has been set successfully.
PMIC_ERR_INVALID_ARGUMENTS The correct argument was not passed.
PMIC_ERR_NO_DEVICE The Wii Speak has been unplugged.
PMIC_ERR_INVALID_STATE The Wii Speak is not open.
PMIC_ERR_BUSY Cannot register the command. Call the function again.
PMIC_ERR_USB_ERROR An error occurred in USB communications. Call the function again.
PMIC_ERR_FATAL A fatal error has occurred.

Description

Synchronously sets the sampling frequency for the audio data received from the Wii Speak.

The sampling frequency is specified in the freq argument. The value can be set to 8000 Hz; 11,025 Hz; or 16,000 Hz. Specify PMIC_FREQ_8KHZ for a sampling frequency of 8000 Hz; PMIC_FREQ_11KHZ for a frequency of 11,025 Hz; or PMIC_FREQ_16KHZ for a frequency of 16,000 Hz. The Wii Speak default sampling frequency is 16,000 Hz.

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 PMICSetSpState(Async) 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.

This function can be called when the Wii Speak is in the STOP state.

See Also

PMICSetEcResetAsync
PMICSetEcReset

Revision History

2009/06/11 Revised the cautions related to the enabled band.
2009/06/09 Revised the cautions related to the enabled band.
2009/04/10 Revised the cautions relating to the sampling frequency.
2008/10/24 Added Return Values.
2008/07/04 Revised the description of PMIC_ERR_INVALID_STATE.
2008/04/18 Initial version.


CONFIDENTIAL