init
TypeScriptstatic init(dataRepresentation: ArrayBuffer): SHSignatureSwift declarationinit(dataRepresentation: Data) throwsclass · iOS 15.0+ · SDK 27.1
class SHSignaturestatic init(dataRepresentation: ArrayBuffer): SHSignatureSwift declarationinit(dataRepresentation: Data) throwsget dataRepresentation(): ArrayBufferSwift declarationvar dataRepresentation: Data { get }get duration(): numberSwift declarationvar duration: TimeInterval { get }slices(start: number, duration: number, stride?: (number) | null): SHSignature_SlicesSwift declarationfunc slices(from start: TimeInterval, duration: TimeInterval, stride: TimeInterval? = nil) throws -> SHSignature.SlicesReturns a sequence of signatures of the specified duration from a starting value, stepping by the stride. - Parameters: - start: The starting value to use for the sequence. - duration: The desired duration of each sliced signature. - stride: The amount to step by for each slice. Must be a non-zero positive value. - Returns: A sequence from `start` of `duration` length. Each value in the sequence is separated by `stride`. When you recognize audio with ``SHSession/match(_:)``, signature duration should be between ``SHCatalog/minimumQuerySignatureDuration`` and ``SHCatalog/maximumQuerySignatureDuration``. Use this method to slice signatures longer than the maximum duration. Slicing allows you to test specific parts of the audio. If you know certain parts of an audio are clearer or more likely to have recognizable content, prioritize matching those slices. The code below creates slices from a signature and uses the first three slices to find a match: ```swift let signature = try await SHSignatureGenerator.signature(from: audioAsset) let slices = try signature.slices(from: 2.0, duration: 10.0, stride: 5.0) // Use the first 3 slices to find a match. for try await slice in slices.prefix(3) { session.match(slice) } ``` You can use AsyncSequence operators like <doc://com.apple.documentation/documentation/swift/asyncsequence/prefix(_:)> or <doc://com.apple.documentation/documentation/swift/asyncsequence/first(where:)> to choose which slices are processed. The `stride` parameter controls overlap between slices. A smaller stride creates more slices with greater overlap, which increases the number of matching requests. Larger strides create fewer slices, however there are fewer matching requests. For continuous matching as audio becomes available, use ``SHSession/matchStreamingBuffer(_:at:)``, which automatically generates and matches signatures from audio buffers.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
SHSignature.init()
inherited init: cannot prove legal (class declares 1 custom initializer)