phpdftk API Documentation

Sound extends PdfStream
in package

Sound object (/Type /Sound) — ISO 32000-2 §13.3.

A stream that holds sampled audio data. Referenced by the /Sound entry of a SoundAction and SoundAnnotation.

Required: R (sample rate). Common: C (channels), B (bits per sample), E (encoding), CO (compression format), CP (compression params).

Attributes
#[DeprecatedPdfFeature]
$since: '2.0'
$replacement: 'MediaRendition'
$removedIn: '2.0'
#[RequiresPdfVersion]
\Phpdftk\Pdf\Core\PdfVersion::V1_2

Table of Contents

Constants

PDF_TYPE  = 'Sound'

Properties

$b  : int|null
$c  : int|null
$co  : PdfName|null
$cp  : PdfDictionary|null
$data  : string
$dictionary  : PdfDictionary
$e  : PdfName|null
$generationNumber  : int
$objectNumber  : int
$r  : float

Methods

__construct()  : mixed
setFilter()  : void
Set a filter to encode/decode the stream data.
toIndirectObject()  : string
Wrap the object in an indirect object structure: X Y obj ... endobj
toPdf()  : string
Returns the stream body: dictionary, stream keyword, data, endstream.

Constants

PDF_TYPE

public mixed PDF_TYPE = 'Sound'

Properties

$b

public int|null $b = null

$c

public int|null $c = null

$generationNumber

public int $generationNumber = 0

Methods

__construct()

public __construct(float $sampleRate[, string $samples = '' ]) : mixed
Parameters
$sampleRate : float
$samples : string = ''

setFilter()

Set a filter to encode/decode the stream data.

public setFilter(FilterInterface $filter, string $pdfFilterName) : void
Parameters
$filter : FilterInterface

The filter implementation

$pdfFilterName : string

The PDF filter name (e.g. 'FlateDecode', 'ASCII85Decode')

toIndirectObject()

Wrap the object in an indirect object structure: X Y obj ... endobj

public toIndirectObject() : string
Return values
string

toPdf()

Returns the stream body: dictionary, stream keyword, data, endstream.

public toPdf() : string

/Length is injected into the dictionary at serialization time. If a filter is set, the data is encoded before writing.

Return values
string

        
On this page

Search results