<!--
{
  "availability" : [
    "iOS: 4.1.0 - 18.0.0",
    "iPadOS: 4.1.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.8.0 - 15.0.0",
    "tvOS: 9.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatch/voiceChat(withName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMatch(im)voiceChatWithName:"
  },
  "title" : "voiceChat(withName:)"
}
-->

# voiceChat(withName:)

Joins the local player to a voice channel.

```
func voiceChat(withName name: String) -> GKVoiceChat?
```

## Parameters

`name`

The name of the channel to join.

## Return Value

A voice chat object for the channel, or `nil` if an error occurs or parental controls restrict the player from joining a voice chat.

## Discussion

This method adds the local player to the named voice chat channel and creates it if necessary. GameKit connects players who join a channel with the same name. A match can have multiple channels and a player can join multiple channels.

When the local player disconnects from a match, all voice channels associated with the match stop working. Therefore, before you disconnect a player, you need to stop the associated voice channels and set the voice chat objects to `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)