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.

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

 Methods

The default constructor

__construct(int $Id) 

Parameters

$Id

int

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

__get()

__get(string $Name) : \method

Parameters

$Name

string

Returns

\method

Retrieves the size of the current chunk

getChunkSize() : int

Returns

int

Retrieves the type of the chunk based on the id passed.

getChunkType(string $Id) : string | null

Parameters

$Id

string

The id of the chunk

Returns

stringnullA string if the chunk is recognized. Null otherwise

Gets the id of the chunk

getId() : \ChunkField

Returns

Gets the size of the chunk

getSize() : \ChunkField

Returns

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

Sets the id of the chunk

setId(\ChunkField $Id) 

Parameters

Sets the size of the chunk

setSize(\ChunkField $Size) 

Parameters

$Size

\ChunkField

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

toString() : string

Returns

string

Initialize the chunk setting the Id and the Size properties

init(int $Id) 

Parameters

$Id

int

The id of the chunk

 Properties

 

The id of the chunk

$Id : \ChunkField

 

The size of the chunk

$Size : \ChunkField

 Constants

 

ID_FORMAT

ID_FORMAT 

 

ID_SIZE

ID_SIZE