<!--
{
  "availability" : [
    "iOS: 8.0.0 - 27.0.0",
    "iPadOS: 8.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.10.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioNode/installTap(onBus:bufferSize:format:block:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioNode(im)installTapOnBus:bufferSize:format:block:"
  },
  "title" : "installTap(onBus:bufferSize:format:block:)"
}
-->

# installTap(onBus:bufferSize:format:block:)

Installs an audio tap on a bus you specify to record, monitor, and observe the output of the node.

```
func installTap(onBus bus: AVAudioNodeBus, bufferSize: AVAudioFrameCount, format: AVAudioFormat?, block tapBlock: @escaping AVAudioNodeTapBlock)
```

## Parameters

`bus`

The output bus to attach the tap to.

`bufferSize`

The size of the incoming buffers. The implementation may choose another size.

`format`

If non-`nil`, the framework applies this format to the output bus you specify. An error occurs when attaching to an output bus that’s already in a connected state. The tap and connection formats (if non-`nil`) on the bus need to be identical. Otherwise, the latter operation overrides the previous format.

    For     `AVAudioOutputNode`    , you must specify the tap format as     `nil`    .

`tapBlock`

A block the framework calls with audio buffers.

## Discussion

You can install and remove taps while the engine is in a running state. You can install only one tap on any bus.

```objc
AVAudioEngine *engine = [[AVAudioEngine alloc] init];
AVAudioInputNode *input = [engine inputNode];
AVAudioFormat *format = [input outputFormatForBus: 0];
[input installTapOnBus: 0 bufferSize: 8192 format: format block: ^(AVAudioPCMBuffer *buf, AVAudioTime *when) {
// __'__buf' contains captured audio from the node at time 'when'
}];
....
// start engine
```

> Important:
> The framework may invoke the `tapBlock` on a thread other than the main thread.

---

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)