<!--
{
  "availability" : [
    "iOS: 10.0.0 - 15.0.0",
    "iPadOS: 10.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SiriKit",
  "identifier" : "/documentation/Intents/INSetAudioSourceInCarIntent/init(audioSource:relativeAudioSourceReference:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Intents"
    ],
    "preciseIdentifier" : "c:objc(cs)INSetAudioSourceInCarIntent(im)initWithAudioSource:relativeAudioSourceReference:"
  },
  "title" : "init(audioSource:relativeAudioSourceReference:)"
}
-->

# init(audioSource:relativeAudioSourceReference:)

Initializes the intent object with the specified audio source information.

```
init(audioSource: INCarAudioSource, relativeAudioSourceReference: INRelativeReference)
```

## Parameters

`audioSource`

The specific audio source to select. If you want to specify the next or previous audio source instead of a specific audio source, specify [`INCarAudioSource.sourceUnknown`](/documentation/Intents/INCarAudioSource/sourceUnknown) for this parameter and specify an appropriate value in the `relativeAudioSourceReference` parameter.

`relativeAudioSourceReference`

The relative audio source to select. If you want to select a specific audio source instead, specify [`INRelativeReference.unknown`](/documentation/Intents/INRelativeReference/unknown) for this parameter and specify an appropriate value in the `audioSource` parameter.

## Return Value

An initialized intent object or `nil` if the object could not be created.

## Discussion

Normally, you don’t create instances of this class yourself. Instead, Siri creates instances when the user asks to change the vehicle’s audio source. However, you can use this method during testing to create intent objects in order to validate your intent handling code paths. Your test code should always specify the unknown constant for one of the parameters; don’t specify the unknown constant for both parameters.

---

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)