AudioClip
@objcMembers
@objc(PESDKAudioClip)
open class AudioClip : NSObject
An AudioClip
represents a single audio clip in an audio clip category.
-
A unqiue string that makes the audio clip unique identifiable.
Declaration
Swift
public let identifier: String
-
The title of the audio clip. If
nil
the title will be fetched from the clip’s metadata if available andAudioClipToolControllerOptions.useMetadata
is set totrue
.Declaration
Swift
public let title: String?
-
The artist of the audio clip. If
nil
the artist will be fetched from the clip’s metadata if available andAudioClipToolControllerOptions.useMetadata
is set totrue
.Declaration
Swift
public let artist: String?
-
The URL for the thumbnail image of the audio clip. If
nil
the artwork will be fetched from the clip’s metadata if available andAudioClipToolControllerOptions.useMetadata
is set totrue
. Otherwise, the thumbnail will be replaced by a placeholder image.Declaration
Swift
public let thumbnailURL: URL?
-
The URL for the audio clip.
Note
Audio clips from remote resources can be used in the editor but their use is not optimized. Remote resources should be downloaded in advance and then passed to the editor as local resources.Declaration
Swift
public let audioURL: URL
-
The length of the audio clip. If
nil
the duration will be fetched from the clip’s metadata if available andAudioClipToolControllerOptions.useMetadata
is set totrue
.Declaration
Swift
public let duration: CMTime?
-
Creates a new
AudioClip
object with the given identifier and audio URL.Declaration
Swift
public convenience init(identifier: String, audioURL: URL)
Parameters
identifier
The title of the audio clip.
audioURL
The URL to the underlying audio.
-
Creates a new
AudioClip
object with the given identifier, audio URL, an optional title, optional artist as well as an optional thumbnail URL.Declaration
Swift
public init(identifier: String, audioURL: URL, title: String?, artist: String?, thumbnailURL: URL?, duration: CMTime?)
Parameters
identifier
The title of the audio clip.
audioURL
The URL to the underlying audio.
title
The title of the audio clip.
artist
The artist of the audio clip.
thumbnailURL
The URL for the thumbnail image of the audio clip.
duration
The duration of the audio clip.
-
Returns the first audio clip with the given identifier if available.
Note
This is a wrapper for
AssetCatalog.shared
.Declaration
Swift
public static func withIdentifier(_ identifier: String) -> AudioClip?
Parameters
identifier
The identifier of the audio clip to look for.
Return Value
The audio clip with the given identifier or
nil
.