<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioConverter/convert(to:from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioConverter(im)convertToBuffer:fromBuffer:error:"
  },
  "title" : "convert(to:from:)"
}
-->

# convert(to:from:)

Performs a basic conversion between audio formats that doesn’t involve converting codecs or sample rates.

```
func convert(to outputBuffer: AVAudioPCMBuffer, from inputBuffer: AVAudioPCMBuffer) throws
```

## Parameters

`outputBuffer`

The output audio buffer.

`inputBuffer`

The input audio buffer.

## Discussion

The output buffer’s [`frameCapacity`](/documentation/AVFAudio/AVAudioPCMBuffer/frameCapacity) value needs to be at least at large as the [`frameLength`](/documentation/AVFAudio/AVAudioPCMBuffer/frameLength) value of the `inputBuffer`.

---

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)