This class represents the value of a chunk.

Although a value in the chunks is always a string, which of course can also represent an integer, I created a whole class to keep track of other info about the value. In fact, every value has potentially a different format (used by pack and unpack function of PHP to extract the value - more info here: http://php.net/manual/en/function.pack.php) and size (in bytes).

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(string $format, int $bytes) 

Parameters

$format

string

The format of the field

$bytes

int

The size of the field

Get the size of the field

getBytes() : int

Returns

int

Get the format of the field

getFormat() : string

Returns

string

Get the value of the field

getValue() : mixed

Returns

mixed

Set the size of the field

setBytes(int $bytes) : void

Parameters

$bytes

int

The size of the field

Exceptions

\InvalidArgumentException If the value isn't positive or integer

Set the format of the field

setFormat(string $format) : void

Parameters

$format

string

The format of the field

Set the value of the field

setValue(mixed $value) : void

Parameters

$value

mixed

The value of the field

 Properties

 

$bytes : int
 

$format : string
 

$value : mixed