---
title: "Microphone"
canonical_url: https://developer.repebble.com/docs/c/User_Interface/Microphone/
last_updated: 2026-11-04
sdk_version: 4.43
---
# Microphone

Source: https://developer.repebble.com/docs/c/User_Interface/Microphone/

The APIs on this page will only work with SDK 4.9+.

## Function Documentation

[MicStreamStartResult](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#MicStreamStartResult) mic\_stream\_to\_phone\_start(MicStreamHandlers handlers, void \* context)

Starts streaming the microphone to the app's PebbleKit JS companion.

#### Parameters
 handlers

`stopped` is required

 context

Passed to the handlers

void mic\_stream\_to\_phone\_stop(void)

Stops streaming. Safe to call when not streaming.

bool mic\_stream\_to\_phone\_is\_active(void)

#### Returns

true while the app is streaming to the phone, including while the phone has yet to accept the stream

MicCaptureStartResult mic\_capture\_start(MicCaptureHandlers handlers, void \* context)

Both handlers are required. Capture starts immediately on success.

void mic\_capture\_stop(void)

Stops capture without calling stopped. Safe while idle.

bool mic\_capture\_is\_active(void)

bool layer\_get\_mic\_accessory\_bounds(const Layer \* layer, [GRect](https://developer.repebble.com/docs/c/Graphics/Graphics_Types.md#GRect) \* bounds\_out)

Get the area next to the system Listening indicator, for the app's own content while it uses the microphone. On rectangular displays the indicator is a bar along the bottom of the screen that shrinks into a square in the bottom-left corner after a few seconds. The bar's height stays obstructed (see [layer\_get\_unobstructed\_bounds](https://developer.repebble.com/docs/c/User_Interface/Layers.md#layer_get_unobstructed_bounds)) and this is the rest of it, to the right of the square: a place for a timer, a level meter or a hint.

Draw in it whenever this returns true. The bar covers it at first and uncovers it as it shrinks, so there is nothing to time. It keeps the bar's height while the indicator slides in and out, so what is drawn in it moves with the indicator. The app redraws whenever it moves, as for the unobstructed area.

It is true from when the app starts using the microphone until the indicator has slid away. On round displays the indicator is a small dome that leaves no room, so this is always false: show that content in the unobstructed area instead.

#### Parameters
 layer

The layer for which to get the area, in its coordinates. The area is clipped to the layer's sides, but not to its top or bottom.

 bounds\_out

The area, or an empty rectangle when there is none.

#### Returns

false when the app is not using the microphone, on round displays and when the area is beside the layer.

#### See Also
[UnobstructedArea](https://developer.repebble.com/docs/c/User_Interface/UnobstructedArea.md)

## Data Structure Documentation

struct MicCaptureHandlers

#### Data Fields
[MicCaptureDataHandler](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#MicCaptureDataHandler) data[MicCaptureStoppedHandler](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#MicCaptureStoppedHandler) stopped

struct MicStreamHandlers

#### Data Fields
[MicStreamStartedHandler](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#MicStreamStartedHandler) started[MicStreamStoppedHandler](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#MicStreamStoppedHandler) stopped

## Enum Documentation

enum MicStreamStartResult

Result of [mic\_stream\_to\_phone\_start](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#mic_stream_to_phone_start).

#### Enumerators
MicStreamStartOk

The stream was requested; `started` is called once the phone accepts it.

MicStreamStartErrBusy

The microphone is in use (by this app or the system)

MicStreamStartErrNotForeground

The app is not in the foreground.

MicStreamStartErrInvalidArgs

Invalid arguments.

MicStreamStartErrNoMemory

Not enough memory to start the stream.

MicStreamStartErrWatchface

Watchfaces can never stream.

MicStreamStartErrUnavailable

This watch has no microphone.

enum MicStreamStopReason

Why the stream ended.

#### Enumerators
MicStreamStopReasonStopped

The app stopped the stream.

MicStreamStopReasonFocusLost

The app lost focus, e.g. a notification appeared.

MicStreamStopReasonInterrupted

The system took the microphone, e.g. for dictation.

MicStreamStopReasonPhone

The phone refused, stopped or lost the stream.

MicStreamStopReasonError

An unexpected error.

enum MicCaptureStartResult

#### Enumerators
MicCaptureStartOkMicCaptureStartErrBusyMicCaptureStartErrNotForegroundMicCaptureStartErrInvalidArgsMicCaptureStartErrWatchfaceMicCaptureStartErrUnavailableMicCaptureStartErrPermissionDeniedMicCaptureStartErrNoMemory

enum MicCaptureStopReason

#### Enumerators
MicCaptureStopReasonFocusLostMicCaptureStopReasonInterruptedMicCaptureStopReasonPermissionRevoked

## Typedef Documentation

 typedef void(\* MicStreamStartedHandler)(void \*context) 

Handler called once the phone has accepted the stream and audio is flowing.

 typedef void(\* MicStreamStoppedHandler)(MicStreamStopReason reason, void \*context) 

Handler called when the stream ends for a reason other than the app stopping it. The stream is gone by the time it is called.

 typedef void(\* MicCaptureDataHandler)(const int16\_t \*samples, size\_t sample\_count, void \*context) 

Runs on the app task. Samples are valid only during this callback. Slow consumers drop frames; each callback receives 320 samples (20 ms).

 typedef void(\* MicCaptureStoppedHandler)(MicCaptureStopReason reason, void \*context) 

Called on the app task when capture ends involuntarily.

## Macro Definition Documentation

#define MIC\_CAPTURE\_SAMPLE\_RATE 16000

Local 16 kHz mono signed 16-bit PCM capture. Requires an explicit Microphone grant synced from the phone. Grants persist offline until updated by the phone. Only foreground watchapps can capture. The system displays its Listening banner (see [layer\_get\_mic\_accessory\_bounds](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#layer_get_mic_accessory_bounds)). Capture and [mic\_stream\_to\_phone\_start](https://developer.repebble.com/docs/c/User_Interface/Microphone.md#mic_stream_to_phone_start) cannot run at the same time.
