esp_err_t Speaker_WriteBuff(uint8_t *buff, uint32_t len, uint32_t timeout)
Plays buffer through the speaker.
Definition: speaker.c:48
Plays buffer through the speaker.
- Note
- The speaker cannot be used at the same time as the microphone since they both share a common pin (GPIO0). Attempting to enable or use both at the same time will cause the device to hard fault.
Example:
Play a sound buffer. The audio clip is too short to be recognized and is just to serve as an example.
const uint8_t sound[16] = [0x01,0x00,0xff,0xff,0x01,0x00,0xff,0xff,0x01,0x00,0xff,0xff,0xff,0xff,0xff,0xff];
void Core2ForAWS_Speaker_Enable(bool state)
Enables or disables the NS4168 speaker amplifier.
Definition: core2forAWS.c:153
void Microphone_Deinit()
De-initializes the microphone over I2S.
Definition: microphone.c:37
esp_err_t Speaker_Deinit()
De-initializes the speaker.
Definition: speaker.c:53
esp_err_t Speaker_Init()
Initializes the speaker over I2S. The I2S bus is initialized for output with a sample rate of 44100Hz...
Definition: speaker.c:12
- Parameters
-
| [out] | buff | The sound buffer to play. |
| [in] | len | Length of the buffer. |
| [in] | timeout | UNUSED. |
- Returns
- esp_err_t. 0 or
ESP_OK if successful.