Show / Hide Table of Contents

# Class Sound

A sound annotation (PDF 1.2) shall analogous to a text annotation except that instead of a text note, it contains sound recorded from the computer's microphone or imported from a file. When the annotation is activated, the sound shall be played. The annotation shall behave like a text annotation in most ways, with a different icon (by default, a speaker) to indicate that it represents a sound.

##### Inheritance

object
Annot
Markup
Sound

##### Implements

IDisposable

##### Inherited Members

Markup.GetTitle()
Markup.SetTitle(string)
Markup.GetPopup()
Markup.SetPopup(Popup)
Markup.GetOpacity()
Markup.SetOpacity(double)
Markup.GetSubject()
Markup.SetSubject(string)
Markup.GetCreationDates()
Markup.SetCreationDates(Date)
Markup.GetBorderEffect()
Markup.SetBorderEffect(Markup.BorderEffect)
Markup.GetBorderEffectIntensity()
Markup.SetBorderEffectIntensity(double)
Markup.GetInteriorColor()
Markup.GetInteriorColorCompNum()
Markup.SetInteriorColor(ColorPt, int)
Markup.GetContentRect()
Markup.SetContentRect(Rect)
Markup.GetPadding()
Markup.SetPadding(Rect)
Markup.RotateAppearance(double)
Annot.GetTriggerAction(Annot.EventType)
Annot.Create(SDFDoc, Annot.Type, Rect)
Annot.op_Assign(Annot)
Annot.Equals(object)
Annot.IsValid()
Annot.GetSDFObj()
Annot.GetType()
Annot.IsMarkup()
Annot.GetRect()
Annot.GetVisibleContentBox()
Annot.SetRect(Rect)
Annot.GetContents()
Annot.SetContents(string)
Annot.GetPage()
Annot.SetPage(Page)
Annot.GetUniqueID()
Annot.SetUniqueID(string)
Annot.GetDate()
Annot.SetDate(Date)
Annot.GetFlag(Annot.Flag)
Annot.SetFlag(Annot.Flag, bool)
Annot.GetBorderStyle()
Annot.SetBorderStyle(Annot.BorderStyle)
Annot.GetAppearance(Annot.AnnotationState, string)
Annot.GetAppearance(Annot.AnnotationState)
Annot.GetAppearance()
Annot.SetAppearance(Obj, Annot.AnnotationState, string)
Annot.SetAppearance(Obj, Annot.AnnotationState)
Annot.SetAppearance(Obj)
Annot.RemoveAppearance(Annot.AnnotationState, string)
Annot.RemoveAppearance(Annot.AnnotationState)
Annot.RemoveAppearance()
Annot.Flatten(Page)
Annot.GetActiveAppearanceState()
Annot.SetActiveAppearanceState(string)
Annot.GetColorAsRGB()
Annot.GetColorAsCMYK()
Annot.GetColorAsGray()
Annot.GetColorCompNum()
Annot.SetColor(ColorPt)
Annot.SetColor(ColorPt, int)
Annot.GetStructParent()
Annot.SetStructParent(int)
Annot.GetOptionalContent()
Annot.SetOptionalContent(Obj)
Annot.Resize(Rect)
Annot.GetRotation()
Annot.SetRotation(int)
Annot.RefreshAppearance(RefreshOptions)
Annot.RefreshAppearance()
Annot.GetCustomData(string)
Annot.SetCustomData(string, string)
Annot.DeleteCustomData(string)
Annot.Dispose()
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.MemberwiseClone()

###### Namespace: pdftron.PDF.Annots

###### Assembly: PDFNet.dll

##### Syntax

    public class Sound : Markup, IDisposable

### Constructors

#### Sound(Annot)

Creates a Sound annotation and initialize it using given annotation object.

##### Declaration

    public Sound(Annot ann)

##### Parameters

Type | Name | Description
--- | --- | ---
Annot | ann | the annot

##### Remarks

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

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Sound(Obj)

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

##### Declaration

    public Sound(Obj d)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | d | the d

##### Remarks

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

### Methods

#### Create(SDFDoc, Rect)

Creates a new Sound annotation, in the specified document.

##### Declaration

    public static Sound Create(SDFDoc doc, Rect pos)

##### Parameters

Type | Name | Description
--- | --- | ---
SDFDoc | doc | A document to which the annotation is added.
Rect | pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

Type | Description
--- | ---
Sound | A newly created blank Sound annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateWithData(SDFDoc, Rect, Filter, int, int, int)

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

    public static Sound CreateWithData(SDFDoc doc, Rect pos, Filter source_data, int bits_per_sample, int sample_freq, int num_channels)

##### Parameters

Type | Name | Description
--- | --- | ---
SDFDoc | doc | A document to which the annotation is added.
Rect | pos | A rectangle specifying the annotation's bounds in default user space units.
Filter | source_data | The raw sound data for the newly created annot
int | bits_per_sample | The number of bits per sample in source data
int | sample_freq | The number of samples per second present in source data
int | num_channels | The number of audio channels in source_data

##### Returns

Type | Description
--- | ---
Sound | A newly created blank Sound annotation.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected override void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

##### Overrides

Markup.Dispose(bool)

#### ~Sound()

##### Declaration

    protected ~Sound()

#### GetIcon()

Gets the sub type of the Sound annotation.

##### Declaration

    public Sound.Icon GetIcon()

##### Returns

Type | Description
--- | ---
Sound.Icon | An entry in the "GetIcon" enum indicating the subtype of the Sound annotation.

##### Remarks

The Icon indicates name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the standard types e_Speaker and e_Mic. Additional types may be supported as well. However, user defined sub types has to be represented by string, in the enum"Icon", it will just show as "e_Unknow". Default value: e_Speaker. The annotation dictionary's AP entry, if present, shall take precedence over the Name entry; see Table'168 and 12.5.5, 'Appearance Streams.'

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetIconName()

Gets the sub type of the Sound annotation.

##### Declaration

    public string GetIconName()

##### Returns

Type | Description
--- | ---
string | A string indicating the subtype of the Sound annotation.

##### Remarks

The Icon indicates a name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the standard types Speaker and Mic. Additional types may be supported as well. Default value: Speaker. The annotation dictionary's AP entry, if present, shall take precedence over the Name entry; see Table'168 and 12.5.5, 'Appearance Streams.'

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetSoundStream()

Gets the initial sound object of the Sound annotation.

##### Declaration

    public Obj GetSoundStream()

##### Returns

Type | Description
--- | ---
Obj | An SDF object representing a sound stream.

##### Remarks

The sound stream is a sound object defining the sound that shall be played when the annotation is activated.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetIcon(string)

Sets the sub type of the Sound annotation. (Optional)

##### Declaration

    public void SetIcon(string type)

##### Parameters

Type | Name | Description
--- | --- | ---
string | type | A string indicating the subtype of the Sound annotation.

##### Remarks

The Icon indicates a name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the standard types Speaker and Mic. Additional types may be supported as well. Default value: Speaker. The annotation dictionary's AP entry, if present, shall take precedence over the Name entry; see Table'168 and 12.5.5, 'Appearance Streams.'

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetIcon(Icon)

Sets the sub type of the Sound annotation. (Optional)

##### Declaration

    public void SetIcon(Sound.Icon type)

##### Parameters

Type | Name | Description
--- | --- | ---
Sound.Icon | type | An entry in the "GetIcon" enum indicating the subtype of the Sound annotation.

##### Remarks

The Icon indicates name of an icon that shall be used in displaying the annotation. Conforming readers shall provide predefined icon appearances for at least the standard types e_Speaker and e_Mic. Additional types may be supported as well. However, user defined sub types has to be represented by string. In the enum"Icon", it will just show as "e_Unknow". Default value: e_Speaker. The annotation dictionary's AP entry, if present, shall take precedence over the Name entry; see Table'168 and 12.5.5, 'Appearance Streams.'

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### SetSoundStream(Obj)

Sets the initial sound object of the Sound annotation.

##### Declaration

    public void SetSoundStream(Obj sound_stream)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | sound_stream | An SDF object representing a sound stream.

##### Remarks

The sound stream is a sound object defining the sound that shall be played when the annotation is activated.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

### Implements

IDisposable