AudioSearch
NewiOSmacOStvOSwatchOSpublic struct AudioSearch : Codable, Equatable, Hashable, SendableResults and metadata for a person's audio search and playback request with Siri.
People use Apple Intelligence and Siri to find and play audio. By integrating your app's audio catalog with Apple Intelligence and Siri using the <doc://com.apple.documentation/documentation/appintents> framework, the system forwards search and playback requests to your app, and your app returns audio search results and allows the system to play your app's songs, podcasts, audiobooks, and so on.
The AudioSearch structure captures a person's audio search and playback request — music, podcasts, audiobooks, or other audio content — along with any Spotlight results the system finds.
Use AudioSearch in your <doc://com.apple.documentation/documentation/appintents/intentvaluequery> implementation to find matching audio content in your app's media catalog.
For more information about allowing people to find audio content in your app with Apple Intelligence and Siri, see <doc://com.apple.documentation/documentation/mediaintents/responding-to-audio-search-and-playback-requests>.
Declaration
public struct AudioSearch : Codable, Equatable, Hashable, Sendable {
/// Creates an audio search with a person's search criteria and Spotlight results.
///
/// - Parameters:
/// - criteria: The search criteria for the audio request.
/// - spotlightSearchResults: Spotlight results the system provides for entity resolution.
public init(criteria: AudioSearch.Criteria, spotlightSearchResults: [AudioSearch.SpotlightResult])
/// The search criteria for the audio request.
public var criteria: AudioSearch.Criteria
/// The Spotlight results the system provides to help you with resolving entities that match the request.
///
/// These results are performance hints. Validate them against your own search
/// results before using them for entity resolution.
public var spotlightSearchResults: [AudioSearch.SpotlightResult]
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (a: AudioSearch, b: AudioSearch) -> Bool
/// Encodes this value into the given encoder.
///
/// If the value fails to encode anything, `encoder` will encode an empty
/// keyed container in its place.
///
/// This function throws an error if any values are invalid for the given
/// encoder's format.
///
/// - Parameter encoder: The encoder to write data to.
public func encode(to encoder: any Encoder) throws
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
/// Creates a new instance by decoding from the given decoder.
///
/// This initializer throws an error if reading from the decoder fails, or
/// if the data read is corrupted or otherwise invalid.
///
/// - Parameter decoder: The decoder to read data from.
public init(from decoder: any Decoder) throws
}