PTSound

@interface PTSound : PTMarkup

A Sound annotation represents a sound recording attached to a point in the PDF document. When closed, this annotation appear as an icon; when open and activated, a sound record from the computer’s microphone or imported from a file associated with this annotation is played.The icon of this annotation by default is a speaker.

  • Creates a Sound annotation and initializes it using given Cos/SDF object.

    Note

    The constructor does not copy any data, but is instead the logical equivalent of a type cast.

    Declaration

    Objective-C

    - (instancetype)initWithD:(PTObj *)d;

    Swift

    init!(d: PTObj!)

    Parameters

    d

    The Cos/SDF object to initialze the annotation with.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithAnn: (PTAnnot*)ann;

    Swift

    init!(ann: PTAnnot!)
  • Creates a new Sound annotation in the specified document.

    Declaration

    Objective-C

    + (PTSound *)CreateSoundWithRect:(PTSDFDoc *)doc
                                 pos:(PTPDFRect *)pos
                                icon:(PTSoundIcon)icon;

    Swift

    class func createSound(withRect doc: PTSDFDoc!, pos: PTPDFRect!, icon: PTSoundIcon) -> PTSound!

    Parameters

    doc

    A document to which the annotation is added.

    pos

    A rectangle specifying the annotation’s bounds in default user space units.

    Return Value

    A newly created blank Sound annotation.

  • Undocumented

    Declaration

    Objective-C

    + (PTSound*)Create: (PTSDFDoc*)doc pos:  (PTPDFRect*)pos;

    Swift

    class func create(_ doc: PTSDFDoc!, pos: PTPDFRect!) -> PTSound!
  • Undocumented

    Declaration

    Objective-C

    + (PTSound*)CreateAnnot: (PTSDFDoc*)doc pos:  (PTPDFRect*)pos icon:  (PTSoundIcon)icon;

    Swift

    class func createAnnot(_ doc: PTSDFDoc!, pos: PTPDFRect!, icon: PTSoundIcon) -> PTSound!
  • Creates a new Sound annotation in the specified document. Accepts raw audio data, along with a few parameters describing the format of that data

    Declaration

    Objective-C

    + (PTSound *)CreateWithData:(PTSDFDoc *)doc
                            pos:(PTPDFRect *)pos
                    source_data:(PTFilter *)source_data
                bits_per_sample:(int)bits_per_sample
                    sample_freq:(int)sample_freq
                   num_channels:(int)num_channels
                           icon:(PTSoundIcon)icon;

    Swift

    class func create(withData doc: PTSDFDoc!, pos: PTPDFRect!, source_data: PTFilter!, bits_per_sample: Int32, sample_freq: Int32, num_channels: Int32, icon: PTSoundIcon) -> PTSound!

    Parameters

    doc

    A document to which the annotation is added.

    pos

    A rectangle specifying the annotation’s bounds in default user space units.

    source_data

    The raw sound data for the newly created annot

    bits_per_sample

    The number of bits per sample in source data

    sample_freq

    The number of samples per second present in source data

    num_channels

    The number of audio channels in source_data

    icon

    A value of the “Icon” enumeration type specifying the icon to display.

    Return Value

    A newly created blank Sound annotation.

  • Creates a new Sound annotation in the specified document.

    Declaration

    Objective-C

    + (PTSound *)CreateSoundWithPoint:(PTSDFDoc *)doc
                                  pos:(PTPDFPoint *)pos
                                 icon:(PTSoundIcon)icon;

    Swift

    class func createSound(withPoint doc: PTSDFDoc!, pos: PTPDFPoint!, icon: PTSoundIcon) -> PTSound!

    Parameters

    doc

    A document to which the annotation is added.

    pos

    A point specifying the annotation’s location in default user space units.

    Return Value

    A newly created blank Sound annotation.

  • Returns the sound object of the Sound annotation.

    Note

    The sound stream is to be played when the Sound annotation is activated.

    Declaration

    Objective-C

    - (PTObj *)GetSoundStream;

    Swift

    func getStream() -> PTObj!

    Return Value

    An SDF object representing a sound stream.

  • Sets the sound object of the Sound annotation.

    Note

    The sound stream is to be played when the Sound annotation is activated.

    Declaration

    Objective-C

    - (void)SetSoundStream:(PTObj *)icon;

    Swift

    func setSoundStream(_ icon: PTObj!)

    Parameters

    icon

    An SDF object representing a sound stream.

  • Returns the Icon of the Sound annotation.

    Note

    The Icon defines the appearance associated with the Sound annotation. The annotation’s appearance stream, if present, will take precedence over this entry.

    Declaration

    Objective-C

    - (PTSoundIcon)GetIcon;

    Swift

    func getIcon() -> PTSoundIcon

    Return Value

    A value of the “Icon” enum. Default value: e_Speaker.

  • Undocumented

    Declaration

    Objective-C

    - (void)SetSoundIconType: (PTSoundIcon)type;

    Swift

    func setSoundIconType(_ type: PTSoundIcon)
  • Sets the Icon of the Sound annotation. (Optional)

    Note

    The Icon defines the appearance associated with the Sound annotation. The annotation’s appearance stream, if present, will take precedence over this entry.

    Declaration

    Objective-C

    - (void)SetIcon;

    Swift

    func setIcon()

    Parameters

    type

    A value of the “Icon” enumeration type specifying the icon to display. Default value: e_Speaker.

  • Returns the Icon name of the Sound annotation.

    Note

    The following Icon names are equivalent to predefined Icons from the enum “Icon”: “Speaker” = e_Speaker “Mic” = e_Mic “Unknown” = e_Unknown The Icon defines the appearance associated with the Sound annotation. Names other than mentioned above do not have predefined icon appearances. The annotation’s appearance stream, if present, will take precedence over this entry.

    Declaration

    Objective-C

    - (NSString *)GetIconName;

    Swift

    func getIconName() -> String!

    Return Value

    A string denoting the Icon name of the Sound annotation.

  • Undocumented

    Declaration

    Objective-C

    - (void)SetSoundIconName: (NSString *)type;

    Swift

    func setSoundIconName(_ type: String!)