Contents

generateSignature(from:completionHandler:)

Creates a signature with the asset you specify.

Declaration

class func generateSignature(from asset: AVAsset, completionHandler: @escaping  @Sendable (SHSignature?, (any Error)?) -> Void)
class func signature(from asset: AVAsset) async throws -> SHSignature

Parameters

  • asset:

    An asset that contains the audio to convert.

  • completionHandler:

    The system calls this completion block after creating the signature, or an error if the system couldn’t create it.

    This block takes the following parameters:

    signature

    A new signature instance.

    error

    An error object if a problem occurs when creating thesignature; otherwise, nil.

Discussion

The asset you specify can be any type of media that contains audio tracks. If the asset has multiple tracks, the system mixes them into one SHSignature.