Foxit PDF SDK
fsdk.Sound Class Reference

Public Member Functions

def GetBits ()
 Get the number of bits per sample value per channel.
More...
 
def GetChannelCount ()
 Get the count of sound channels.
More...
 
def GetCompressionFormat ()
 Get the name of the sound compression format used on the sample data.
More...
 
def GetFileSpec ()
 Get the file specification object which represents an external sound file.
More...
 
def GetSampleEncodingFormat ()
 Get the encoding format for the sample data.
More...
 
def GetSamplingRate ()
 Get the sampling rate, in samples per second.
More...
 
def GetSoundStream ()
 Get the stream of sound data.
More...
 

Detailed Description

A sound annotation (PDF 1.2) is 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. Sound annotation is a kind of markup annotation, so class Sound is derived from class Markup . Currently, only support to get the properties or data of a sound annotation. Not support to modify a sound annotation (including reseting appearance) yet.

See also
Markup

Member Function Documentation

◆ GetBits()

def fsdk.Sound.GetBits ( )

Get the number of bits per sample value per channel.

Returns
The number of bits per sample value per channel.

◆ GetChannelCount()

def fsdk.Sound.GetChannelCount ( )

Get the count of sound channels.

Returns
The count of sound channels.

◆ GetCompressionFormat()

def fsdk.Sound.GetCompressionFormat ( )

Get the name of the sound compression format used on the sample data.

Returns
The name of the sound compression format used on the sample data.

◆ GetFileSpec()

def fsdk.Sound.GetFileSpec ( )

Get the file specification object which represents an external sound file.

A sound may be defined in an external file (represented by a file specification object). The sound file should be self- describing, containing all information needed to render the sound; no additional information need be present in the PDF file.
In this case, the returned stream object should be ignored.

Returns
A file specification object which represents an external sound file. If the return value of function fsdk.FileSpec.IsEmpty for the returned file specification object is true, that means no external sound file is used for current sound annotation. In this case, please use function fsdk.Sound.GetSoundStream to get the sound data.

◆ GetSampleEncodingFormat()

def fsdk.Sound.GetSampleEncodingFormat ( )

Get the encoding format for the sample data.

Returns
The encoding format for the sample data. Please refer to values starting from fsdk.SoundE_SampleEncodingFormatRaw and this would be one of these values.

◆ GetSamplingRate()

def fsdk.Sound.GetSamplingRate ( )

Get the sampling rate, in samples per second.

Returns
The sampling rate. If there is any error, this function will return -1.

◆ GetSoundStream()

def fsdk.Sound.GetSoundStream ( )

Get the stream of sound data.

The stream of sound data represents the sound and can be used to be played when the annotation is activated.
Specially, if function fsdk.Sound.GetFileSpec returns a valid file specification object (whose fsdk.FileSpec.IsEmpty returns false), please use that file specification object instead of the stream returned by this function.

Returns
The stream of sound data. If there is no "Sound" entry or any error occurs, this function will return null.