<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ShazamKit",
  "identifier" : "/documentation/ShazamKit/SHSignature",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ShazamKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SHSignature"
  },
  "title" : "SHSignature"
}
-->

# SHSignature

An object that contains the opaque data and other information for a signature.

```
class SHSignature
```

## Overview

You can save signatures to files and share them with others. Use saved signatures
to populate a custom catalog.

Check whether your captured query signature is long enough to search for a match by comparing
[`duration`](/documentation/ShazamKit/SHSignature/duration) to the [`minimumQuerySignatureDuration`](/documentation/ShazamKit/SHCatalog/minimumQuerySignatureDuration) and [`maximumQuerySignatureDuration`](/documentation/ShazamKit/SHCatalog/maximumQuerySignatureDuration) of a catalog.

For signatures longer than [`maximumQuerySignatureDuration`](/documentation/ShazamKit/SHCatalog/maximumQuerySignatureDuration), use
[`slices(from:duration:stride:)`](/documentation/ShazamKit/SHSignature/slices(from:duration:stride:)) to create multiple segments that meet the duration requirement.

## Topics

### Creating a signature object

[`+ (SHSignature *) signatureWithDataRepresentation:(NSData *) dataRepresentation error:(NSError **) error;`](/documentation/ShazamKit/SHSignature/signatureWithDataRepresentation:error:)

Creates a signature object from raw data.

[`init(dataRepresentation: Data) throws`](/documentation/ShazamKit/SHSignature/init(dataRepresentation:))

Creates a signature object from raw data.

### Reading signature information

[`var dataRepresentation: Data`](/documentation/ShazamKit/SHSignature/dataRepresentation)

The raw data for the signature.

[`var duration: TimeInterval`](/documentation/ShazamKit/SHSignature/duration)

The duration of the audio you use to generate the signature.

### Slicing signature segments

[`func slices(from: TimeInterval, duration: TimeInterval, stride: TimeInterval?) throws -> SHSignature.Slices`](/documentation/ShazamKit/SHSignature/slices(from:duration:stride:))

Returns a sequence of signatures of the specified duration from a starting value, stepping by the stride.

[`struct Slices`](/documentation/ShazamKit/SHSignature/Slices)

A sequence of signature segments.

### Getting the content type

  <doc://com.apple.documentation/documentation/UniformTypeIdentifiers/UTType-swift.struct/shazamSignature>

  <doc://com.apple.documentation/documentation/UniformTypeIdentifiers/UTType-c.class/SHSignatureContentType>

### Initializers

[`init?(coder: NSCoder)`](/documentation/ShazamKit/SHSignature/init(coder:))

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)