This is a generic class which represents a chunk.

Every chunk which a wav file is composed of, has common features and that is a unique id for its type and a size. Thus in Audero Wav Extractor library every chunk extends this generic class that contains a set of methods which are valid and useful for every extended class.

LICENSE: "Audero Wav Extractor" (from now on "The software") is released under the CC BY-NC 3.0 ("Creative Commons Attribution NonCommercial 3.0") license. More details can be found here: http://creativecommons.org/licenses/by-nc/3.0/

WARRANTY: The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

package Audero\Audero\Wav
author Aurelio De Rosa
license CC BY-NC 3.0
link https://bitbucket.org/AurelioDeRosa/audero-wav-extractor

 Methods

The default constructor

__construct(int $id) 

Parameters

$id

int

The id of the chunk. If not provided 0 will be used

Magic method to execute the getter associated to the property name given

__get(string $name) : mixed

Parameters

$name

string

The name of the property

Exceptions

\Exception If the method doesn't exists

Returns

mixedThe result of the invoked method

Retrieves the size of the current chunk

getChunkSize() : int

Returns

int

Retrieves the chunk type based on the given id

getChunkType(string $id) : \Audero\WavExtractor\Wav\Chunk
Static

Parameters

$id

string

The id of the chunk

Returns

Get the id of the chunk

getId() : \Audero\WavExtractor\Wav\ChunkField

Get the size of the chunk

getSize() : \Audero\WavExtractor\Wav\ChunkField

Read the data inside the managed file to fill the properties of the current chunk.

readData(resource $handle) : int

Parameters

$handle

resource

The handle of the managed file

Returns

intThe amount of bytes read

Set the id of the chunk

setId(\Audero\WavExtractor\Wav\ChunkField $id) : \Audero\WavExtractor\Wav\Chunk

Parameters

$id

\Audero\WavExtractor\Wav\ChunkField

The id of the chunk

Returns

Set the size of the chunk

setSize(\Audero\WavExtractor\Wav\ChunkField $size) : \Audero\WavExtractor\Wav\Chunk

Parameters

$size

\Audero\WavExtractor\Wav\ChunkField

The size of the chunk

Returns

Converts the current chunk into a string based on the values of its properties

toString() : string

Returns

string

 Properties

   

 Constants

 

ID_FORMAT

ID_FORMAT 
 

ID_SIZE

ID_SIZE