---
title: "setMicrophoneCaptureState(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webpage/setmicrophonecapturestate(_:)"
---

# setMicrophoneCaptureState(_:)

Changes whether the webpage is using the microphone to capture audio.

## Declaration

```swift
@MainActor final func setMicrophoneCaptureState(_ state: WKMediaCaptureState) async
```

## Parameters

- `state`: The new capture state the page should use.

## See Also

### Managing the microphone and camera

- [cameraCaptureState](webkit/webpage/cameracapturestate.md)
- [microphoneCaptureState](webkit/webpage/microphonecapturestate.md)
- [setCameraCaptureState(_:)](webkit/webpage/setcameracapturestate(_:).md)
