|
ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
Collaboration diagram for WavFile:Public Member Functions | |
| __construct ($numChannelsOrFileName=null, $sampleRateOrReadData=null, $bitsPerSample=null) | |
| WavFile Constructor. More... | |
| __destruct () | |
| __clone () | |
| __toString () | |
| Output the wav file headers and data. More... | |
| getActualSize () | |
| getChunkSize () | |
| getFmtChunkSize () | |
| getFmtExtendedSize () | |
| getFactChunkSize () | |
| getDataSize () | |
| getDataOffset () | |
| getAudioFormat () | |
| getAudioSubFormat () | |
| getNumChannels () | |
| setNumChannels ($numChannels) | |
| getChannelMask () | |
| setChannelMask ($channelMask=self::SPEAKER_DEFAULT) | |
| getSampleRate () | |
| setSampleRate ($sampleRate) | |
| getBitsPerSample () | |
| setBitsPerSample ($bitsPerSample) | |
| getValidBitsPerSample () | |
| getBlockAlign () | |
| getNumBlocks () | |
| getByteRate () | |
| getSamples () | |
| setSamples (&$samples='') | |
| getMinAmplitude () | |
| getZeroAmplitude () | |
| getMaxAmplitude () | |
| makeHeader () | |
| Construct a wav header from this object. More... | |
| getDataSubchunk () | |
| Construct wav DATA chunk. More... | |
| save ($filename) | |
| Save the wav data to a file. More... | |
| openWav ($filename, $readData=true) | |
| Reads a wav header and data from a file. More... | |
| closeWav () | |
| Close a with openWav() previously opened wav file or free the buffer of setWavData(). More... | |
| setWavData (&$data, $free=true) | |
| Set the wav file data and properties from a wav file in a string. More... | |
| readWavData ($dataOffset=0, $dataSize=null) | |
| Read the wav data from the file into the buffer. More... | |
| getSampleBlock ($blockNum) | |
| Return a single sample block from the file. More... | |
| setSampleBlock ($sampleBlock, $blockNum) | |
| Set a single sample block. More... | |
| getSampleValue ($blockNum, $channelNum) | |
| Get a float sample value for a specific sample block and channel number. More... | |
| setSampleValue ($sampleFloat, $blockNum, $channelNum) | |
| Sets a float sample value for a specific sample block number and channel. More... | |
| filter ($filters, $blockOffset=0, $numBlocks=null) | |
| Run samples through audio processing filters. More... | |
| appendWav (WavFile $wav) | |
| Append a wav file to the current wav. More... | |
| mergeWav (WavFile $wav, $normalizeThreshold=null) | |
| Mix 2 wav files together. More... | |
| insertSilence ($duration=1.0) | |
| Add silence to the wav file. More... | |
| degrade ($quality=1.0) | |
| Degrade the quality of the wav file by introducing random noise. More... | |
| generateNoise ($duration=1.0, $percent=100) | |
| Generate noise at the end of the wav for the specified duration and volume. More... | |
| convertBitsPerSample ($bitsPerSample) | |
| Convert sample data to different bits per sample. More... | |
| displayInfo () | |
| Output information about the wav object. More... | |
Static Public Member Functions | |
| static | unpackSample ($sampleBinary, $bitDepth=null) |
| Unpacks a single binary sample to numeric value. More... | |
| static | packSample ($sample, $bitDepth) |
| Packs a single numeric sample to binary. More... | |
| static | unpackSampleBlock ($sampleBlock, $bitDepth, $numChannels=null) |
| Unpacks a binary sample block to numeric values. More... | |
| static | packSampleBlock ($samples, $bitDepth) |
| Packs an array of numeric channel samples to a binary sample block. More... | |
| static | normalizeSample ($sampleFloat, $threshold) |
| Normalizes a float audio sample. More... | |
Data Fields | |
| const | FILTER_MIX = 0x01 |
| const | FILTER_NORMALIZE = 0x02 |
| const | FILTER_DEGRADE = 0x04 |
| const | MAX_CHANNEL = 18 |
| const | MAX_SAMPLERATE = 192000 |
| const | SPEAKER_DEFAULT = 0x000000 |
| Channel Locations for ChannelMask. More... | |
| const | SPEAKER_FRONT_LEFT = 0x000001 |
| const | SPEAKER_FRONT_RIGHT = 0x000002 |
| const | SPEAKER_FRONT_CENTER = 0x000004 |
| const | SPEAKER_LOW_FREQUENCY = 0x000008 |
| const | SPEAKER_BACK_LEFT = 0x000010 |
| const | SPEAKER_BACK_RIGHT = 0x000020 |
| const | SPEAKER_FRONT_LEFT_OF_CENTER = 0x000040 |
| const | SPEAKER_FRONT_RIGHT_OF_CENTER = 0x000080 |
| const | SPEAKER_BACK_CENTER = 0x000100 |
| const | SPEAKER_SIDE_LEFT = 0x000200 |
| const | SPEAKER_SIDE_RIGHT = 0x000400 |
| const | SPEAKER_TOP_CENTER = 0x000800 |
| const | SPEAKER_TOP_FRONT_LEFT = 0x001000 |
| const | SPEAKER_TOP_FRONT_CENTER = 0x002000 |
| const | SPEAKER_TOP_FRONT_RIGHT = 0x004000 |
| const | SPEAKER_TOP_BACK_LEFT = 0x008000 |
| const | SPEAKER_TOP_BACK_CENTER = 0x010000 |
| const | SPEAKER_TOP_BACK_RIGHT = 0x020000 |
| const | SPEAKER_ALL = 0x03FFFF |
| const | WAVE_FORMAT_PCM = 0x0001 |
| const | WAVE_FORMAT_IEEE_FLOAT = 0x0003 |
| const | WAVE_FORMAT_EXTENSIBLE = 0xFFFE |
| const | WAVE_SUBFORMAT_PCM = "0100000000001000800000aa00389b71" |
| const | WAVE_SUBFORMAT_IEEE_FLOAT = "0300000000001000800000aa00389b71" |
Protected Member Functions | |
| setActualSize ($actualSize=null) | |
| setChunkSize ($chunkSize=null) | |
| setFmtChunkSize ($fmtChunkSize=null) | |
| setFmtExtendedSize ($fmtExtendedSize=null) | |
| setFactChunkSize ($factChunkSize=null) | |
| setDataSize ($dataSize=null) | |
| setDataOffset ($dataOffset=null) | |
| setAudioFormat ($audioFormat=null) | |
| setAudioSubFormat ($audioSubFormat=null) | |
| setValidBitsPerSample ($validBitsPerSample=null) | |
| setBlockAlign ($blockAlign=null) | |
| setNumBlocks ($numBlocks=null) | |
| setByteRate ($byteRate=null) | |
| readWav ($readData=true) | |
| Read wav file from a stream. More... | |
| readWavHeader () | |
| Parse a wav header. More... | |
Static Protected Attributes | |
| static | $LOOKUP_LOGBASE |
Definition at line 69 of file WavFile.php.
| WavFile::__construct | ( | $numChannelsOrFileName = null, |
|
$sampleRateOrReadData = null, |
|||
$bitsPerSample = null |
|||
| ) |
WavFile Constructor.
$wav1 = new WavFile(2, 44100, 16); // new wav with 2 channels, at 44100 samples/sec and 16 bits per sample $wav2 = new WavFile('./audio/sound.wav'); // open and read wav file
| string | int | $numChannelsOrFileName | (Optional) If string, the filename of the wav file to open. The number of channels otherwise. Defaults to 1. |
| int | bool | $sampleRateOrReadData | (Optional) If opening a file and boolean, decides whether to read the data chunk or not. Defaults to true. The sample rate in samples per second otherwise. 8000 = standard telephone, 16000 = wideband telephone, 32000 = FM radio and 44100 = CD quality. Defaults to 8000. |
| int | $bitsPerSample | (Optional) The number of bits per sample. Has to be 8, 16 or 24 for PCM audio or 32 for IEEE FLOAT audio. 8 = telephone, 16 = CD and 24 or 32 = studio quality. Defaults to 8. |
| WavFormatException | |
| WavFileException |
Definition at line 221 of file WavFile.php.
References openWav(), setNumChannels(), SPEAKER_DEFAULT, and WAVE_FORMAT_PCM.
Here is the call graph for this function:| WavFile::__destruct | ( | ) |
Definition at line 255 of file WavFile.php.
References closeWav().
Here is the call graph for this function:| WavFile::__clone | ( | ) |
Definition at line 262 of file WavFile.php.
| WavFile::__toString | ( | ) |
Output the wav file headers and data.
Definition at line 272 of file WavFile.php.
References getDataSubchunk(), and makeHeader().
Here is the call graph for this function:| WavFile::appendWav | ( | WavFile | $wav | ) |
Append a wav file to the current wav.
The wav files must have the same sample rate, number of bits per sample, and number of channels.
| WavFile | $wav | (Required) The wav file to append. |
| WavFileException |
Definition at line 1736 of file WavFile.php.
References getBitsPerSample(), getNumChannels(), getSampleRate(), and setDataSize().
Here is the call graph for this function:| WavFile::closeWav | ( | ) |
Close a with openWav() previously opened wav file or free the buffer of setWavData().
Not necessary if the data has been read (readData = true) already.
Definition at line 994 of file WavFile.php.
Referenced by __destruct(), openWav(), readWav(), readWavData(), and setWavData().
Here is the caller graph for this function:| WavFile::convertBitsPerSample | ( | $bitsPerSample | ) |
Convert sample data to different bits per sample.
| int | $bitsPerSample | (Required) The new number of bits per sample; |
| WavFileException |
Definition at line 1839 of file WavFile.php.
References getBitsPerSample(), getNumBlocks(), getNumChannels(), getSampleRate(), setDataSize(), and setSamples().
Here is the call graph for this function:| WavFile::degrade | ( | $quality = 1.0 | ) |
Degrade the quality of the wav file by introducing random noise.
| float | quality (Optional) The quality relative to the amplitude. 1 = no noise, 0 = max. noise. |
Definition at line 1796 of file WavFile.php.
References filter(), and FILTER_DEGRADE.
Here is the call graph for this function:| WavFile::displayInfo | ( | ) |
Output information about the wav object.
Definition at line 1867 of file WavFile.php.
References getActualSize(), getAudioFormat(), getAudioSubFormat(), getBitsPerSample(), getBlockAlign(), getByteRate(), getChannelMask(), getChunkSize(), getDataOffset(), getDataSize(), getFactChunkSize(), getFmtChunkSize(), getFmtExtendedSize(), getNumBlocks(), getNumChannels(), getSampleRate(), and getValidBitsPerSample().
Here is the call graph for this function:| WavFile::filter | ( | $filters, | |
$blockOffset = 0, |
|||
$numBlocks = null |
|||
| ) |
Run samples through audio processing filters.
$wav->filter( array( WavFile::FILTER_MIX => array( // Filter for mixing 2 WavFile instances. 'wav' => $wav2, // (Required) The WavFile to mix into this WhavFile. If no optional arguments are given, can be passed without the array. 'loop' => true, // (Optional) Loop the selected portion (with warping to the beginning at the end). 'blockOffset' => 0, // (Optional) Block number to start mixing from. 'numBlocks' => null // (Optional) Number of blocks to mix in or to select for looping. Defaults to the end or all data for looping. ), WavFile::FILTER_NORMALIZE => 0.6, // (Required) Normalization of (mixed) audio samples - see threshold parameter for normalizeSample(). WavFile::FILTER_DEGRADE => 0.9 // (Required) Introduce random noise. The quality relative to the amplitude. 1 = no noise, 0 = max. noise. ), 0, // (Optional) The block number of this WavFile to start with. null // (Optional) The number of blocks to process. );
| array | $filters | (Required) An array of 1 or more audio processing filters. |
| int | $blockOffset | (Optional) The block number to start precessing from. |
| int | $numBlocks | (Optional) The maximum number of blocks to process. |
| WavFileException |
Definition at line 1615 of file WavFile.php.
References FILTER_DEGRADE, FILTER_MIX, FILTER_NORMALIZE, getNumBlocks(), getNumChannels(), getSampleValue(), normalizeSample(), and setSampleValue().
Referenced by degrade(), and mergeWav().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::generateNoise | ( | $duration = 1.0, |
|
$percent = 100 |
|||
| ) |
Generate noise at the end of the wav for the specified duration and volume.
| float | $duration | (Optional) Number of seconds of noise to generate. |
| float | $percent | (Optional) The percentage of the maximum amplitude to use. 100 = full amplitude. |
Definition at line 1809 of file WavFile.php.
References getBitsPerSample(), getMaxAmplitude(), getMinAmplitude(), getNumChannels(), getSampleRate(), and setDataSize().
Here is the call graph for this function:| WavFile::getActualSize | ( | ) |
Definition at line 459 of file WavFile.php.
References $_actualSize.
Referenced by displayInfo().
Here is the caller graph for this function:| WavFile::getAudioFormat | ( | ) |
Definition at line 603 of file WavFile.php.
References $_audioFormat.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getAudioSubFormat | ( | ) |
Definition at line 634 of file WavFile.php.
References $_audioSubFormat.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getBitsPerSample | ( | ) |
Definition at line 723 of file WavFile.php.
References $_bitsPerSample.
Referenced by appendWav(), convertBitsPerSample(), displayInfo(), generateNoise(), insertSilence(), and makeHeader().
Here is the caller graph for this function:| WavFile::getBlockAlign | ( | ) |
Definition at line 766 of file WavFile.php.
References $_blockAlign.
Referenced by displayInfo(), makeHeader(), and readWavData().
Here is the caller graph for this function:| WavFile::getByteRate | ( | ) |
Definition at line 800 of file WavFile.php.
References $_byteRate.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getChannelMask | ( | ) |
Definition at line 676 of file WavFile.php.
References $_channelMask.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getChunkSize | ( | ) |
Definition at line 475 of file WavFile.php.
References $_chunkSize.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getDataOffset | ( | ) |
Definition at line 583 of file WavFile.php.
References $_dataOffset.
Referenced by displayInfo().
Here is the caller graph for this function:| WavFile::getDataSize | ( | ) |
Definition at line 563 of file WavFile.php.
References $_dataSize.
Referenced by displayInfo(), and getDataSubchunk().
Here is the caller graph for this function:| WavFile::getDataSubchunk | ( | ) |
Construct wav DATA chunk.
Definition at line 925 of file WavFile.php.
References getDataSize(), and setDataSize().
Referenced by __toString(), and save().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::getFactChunkSize | ( | ) |
Definition at line 540 of file WavFile.php.
References $_factChunkSize.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getFmtChunkSize | ( | ) |
Definition at line 497 of file WavFile.php.
References $_fmtChunkSize.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getFmtExtendedSize | ( | ) |
Definition at line 516 of file WavFile.php.
References $_fmtExtendedSize.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getMaxAmplitude | ( | ) |
Definition at line 860 of file WavFile.php.
Referenced by generateNoise().
Here is the caller graph for this function:| WavFile::getMinAmplitude | ( | ) |
Definition at line 838 of file WavFile.php.
Referenced by generateNoise().
Here is the caller graph for this function:| WavFile::getNumBlocks | ( | ) |
Definition at line 784 of file WavFile.php.
References $_numBlocks.
Referenced by convertBitsPerSample(), displayInfo(), filter(), and makeHeader().
Here is the caller graph for this function:| WavFile::getNumChannels | ( | ) |
Definition at line 654 of file WavFile.php.
References $_numChannels.
Referenced by appendWav(), convertBitsPerSample(), displayInfo(), filter(), generateNoise(), insertSilence(), and makeHeader().
Here is the caller graph for this function:| WavFile::getSampleBlock | ( | $blockNum | ) |
Return a single sample block from the file.
| int | $blockNum | (Required) The sample block number. Zero based. |
Definition at line 1363 of file WavFile.php.
References $_blockAlign, and setDataSize().
Here is the call graph for this function:| WavFile::getSampleRate | ( | ) |
Definition at line 703 of file WavFile.php.
References $_sampleRate.
Referenced by appendWav(), convertBitsPerSample(), displayInfo(), generateNoise(), insertSilence(), and makeHeader().
Here is the caller graph for this function:| WavFile::getSamples | ( | ) |
Definition at line 816 of file WavFile.php.
References $_samples.
| WavFile::getSampleValue | ( | $blockNum, | |
| $channelNum | |||
| ) |
Get a float sample value for a specific sample block and channel number.
| int | $blockNum | (Required) The sample block number to fetch. Zero based. |
| int | $channelNum | (Required) The channel number within the sample block to fetch. First channel is 1. |
| WavFileException |
Definition at line 1433 of file WavFile.php.
References $data, Vendor\Package\$sample, and setDataSize().
Referenced by filter().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::getValidBitsPerSample | ( | ) |
Definition at line 745 of file WavFile.php.
References $_validBitsPerSample.
Referenced by displayInfo(), and makeHeader().
Here is the caller graph for this function:| WavFile::getZeroAmplitude | ( | ) |
Definition at line 849 of file WavFile.php.
Referenced by insertSilence().
Here is the caller graph for this function:| WavFile::insertSilence | ( | $duration = 1.0 | ) |
Add silence to the wav file.
| float | $duration | (Optional) How many seconds of silence. If negative, add to the beginning of the file. Defaults to 1s. |
Definition at line 1774 of file WavFile.php.
References $_samples, $data, getBitsPerSample(), getNumChannels(), getSampleRate(), getZeroAmplitude(), and setDataSize().
Here is the call graph for this function:| WavFile::makeHeader | ( | ) |
Construct a wav header from this object.
Includes "fact" chunk in necessary. http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html
Definition at line 881 of file WavFile.php.
References getAudioFormat(), getAudioSubFormat(), getBitsPerSample(), getBlockAlign(), getByteRate(), getChannelMask(), getChunkSize(), getFactChunkSize(), getFmtChunkSize(), getFmtExtendedSize(), getNumBlocks(), getNumChannels(), getSampleRate(), getValidBitsPerSample(), setAudioFormat(), and setNumBlocks().
Referenced by __toString(), and save().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::mergeWav | ( | WavFile | $wav, |
$normalizeThreshold = null |
|||
| ) |
Mix 2 wav files together.
Both wavs must have the same sample rate and same number of channels.
| WavFile | $wav | (Required) The WavFile to mix. |
| float | $normalizeThreshold | (Optional) See normalizeSample for an explanation. |
| WavFileException |
Definition at line 1761 of file WavFile.php.
References filter(), FILTER_MIX, and FILTER_NORMALIZE.
Here is the call graph for this function:
|
static |
Normalizes a float audio sample.
Maximum input range assumed for compression is [-2, 2]. See http://www.voegler.eu/pub/audio/ for more information.
| float | $sampleFloat | (Required) The float sample to normalize. |
| float | $threshold | (Required) The threshold or gain factor for normalizing the amplitude.
|
Definition at line 424 of file WavFile.php.
Referenced by filter().
Here is the caller graph for this function:| WavFile::openWav | ( | $filename, | |
$readData = true |
|||
| ) |
Reads a wav header and data from a file.
| string | $filename | (Required) The path to the wav file to read. |
| bool | $readData | (Optional) If true, also read the data chunk. |
| WavFormatException | |
| WavFileException |
Definition at line 968 of file WavFile.php.
References $filename, closeWav(), and readWav().
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Packs a single numeric sample to binary.
| int | float | $sample | (Required) The sample to encode. Has to be within valid range for $bitDepth. Float values only for 32 bits. |
| int | $bitDepth | (Required) The bits per sample to encode with. |
Definition at line 335 of file WavFile.php.
References Vendor\Package\$sample.
Referenced by packSampleBlock().
Here is the caller graph for this function:
|
static |
Packs an array of numeric channel samples to a binary sample block.
| array | $samples | (Required) The array of channel sample values. Expects float values for 32 bits and integer otherwise. |
| int | $bitDepth | (Required) The bits per sample to encode with. |
Definition at line 396 of file WavFile.php.
References Vendor\Package\$sample, and packSample().
Here is the call graph for this function:
|
protected |
Read wav file from a stream.
| $readData | (Optional) If true, also read the data chunk. |
| WavFormatException | |
| WavFileException |
Definition at line 1045 of file WavFile.php.
References closeWav(), readWavData(), and readWavHeader().
Referenced by openWav(), and setWavData().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::readWavData | ( | $dataOffset = 0, |
|
$dataSize = null |
|||
| ) |
Read the wav data from the file into the buffer.
| $dataOffset | (Optional) The byte offset to skip before starting to read. Must be a multiple of BlockAlign. |
| $dataSize | (Optional) The size of the data to read in bytes. Must be a multiple of BlockAlign. Defaults to all data. |
| WavFileException |
Definition at line 1322 of file WavFile.php.
References closeWav(), getBlockAlign(), and setDataSize().
Referenced by readWav().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Parse a wav header.
http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html
| WavFormatException | |
| WavFileException |
Definition at line 1072 of file WavFile.php.
References Vendor\Package\$c, and $n.
Referenced by readWav().
Here is the caller graph for this function:| WavFile::save | ( | $filename | ) |
Save the wav data to a file.
| string | $filename | (Required) The file path to save the wav to. |
| WavFileException |
Definition at line 946 of file WavFile.php.
References $filename, getDataSubchunk(), and makeHeader().
Here is the call graph for this function:
|
protected |
Definition at line 464 of file WavFile.php.
References $_chunkSize.
Referenced by setChunkSize().
Here is the caller graph for this function:
|
protected |
Definition at line 608 of file WavFile.php.
References setAudioSubFormat(), WAVE_FORMAT_EXTENSIBLE, WAVE_FORMAT_IEEE_FLOAT, and WAVE_FORMAT_PCM.
Referenced by makeHeader(), setChannelMask(), setNumChannels(), and setValidBitsPerSample().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 639 of file WavFile.php.
References WAVE_SUBFORMAT_IEEE_FLOAT, and WAVE_SUBFORMAT_PCM.
Referenced by setAudioFormat().
Here is the caller graph for this function:| WavFile::setBitsPerSample | ( | $bitsPerSample | ) |
Definition at line 728 of file WavFile.php.
References setValidBitsPerSample().
Here is the call graph for this function:
|
protected |
Definition at line 771 of file WavFile.php.
References setNumBlocks().
Here is the call graph for this function:
|
protected |
Definition at line 805 of file WavFile.php.
Referenced by setSampleRate().
Here is the caller graph for this function:| WavFile::setChannelMask | ( | $channelMask = self::SPEAKER_DEFAULT | ) |
Definition at line 681 of file WavFile.php.
References Vendor\Package\$c, $n, and setAudioFormat().
Here is the call graph for this function:
|
protected |
Definition at line 480 of file WavFile.php.
References setActualSize().
Referenced by setDataSize(), setFactChunkSize(), and setFmtChunkSize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 588 of file WavFile.php.
|
protected |
Definition at line 568 of file WavFile.php.
References setChunkSize().
Referenced by appendWav(), convertBitsPerSample(), generateNoise(), getDataSubchunk(), getSampleBlock(), getSampleValue(), insertSilence(), readWavData(), setSampleBlock(), setSamples(), and setSampleValue().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 545 of file WavFile.php.
References setChunkSize().
Here is the call graph for this function:
|
protected |
Definition at line 502 of file WavFile.php.
References $_fmtExtendedSize, and setChunkSize().
Referenced by setFmtExtendedSize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 521 of file WavFile.php.
References setFmtChunkSize().
Here is the call graph for this function:
|
protected |
Definition at line 789 of file WavFile.php.
Referenced by makeHeader(), and setBlockAlign().
Here is the caller graph for this function:| WavFile::setNumChannels | ( | $numChannels | ) |
Definition at line 659 of file WavFile.php.
References setAudioFormat().
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::setSampleBlock | ( | $sampleBlock, | |
| $blockNum | |||
| ) |
Set a single sample block.
Allows to append a sample block.
| string | $sampleBlock | (Required) The binary sample block (all channels). |
| int | $blockNum | (Required) The sample block number. Zero based. |
| WavFileException |
Definition at line 1388 of file WavFile.php.
References $_blockAlign, $i, and setDataSize().
Here is the call graph for this function:| WavFile::setSampleRate | ( | $sampleRate | ) |
Definition at line 708 of file WavFile.php.
References setByteRate().
Here is the call graph for this function:| WavFile::setSamples | ( | & | $samples = '' | ) |
Definition at line 821 of file WavFile.php.
References setDataSize().
Referenced by convertBitsPerSample().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::setSampleValue | ( | $sampleFloat, | |
| $blockNum, | |||
| $channelNum | |||
| ) |
Sets a float sample value for a specific sample block number and channel.
Converts float values to appropriate integer values and clips properly.
Allows to append samples (in order).
| float | $sampleFloat | (Required) The float sample value to set. Converts float values and clips if necessary. |
| int | $blockNum | (Required) The sample block number to set or append. Zero based. |
| int | $channelNum | (Required) The channel number within the sample block to set or append. First channel is 1. |
| WavFileException |
Definition at line 1497 of file WavFile.php.
References $_bitsPerSample, $_dataSize, $i, Vendor\Package\$sample, and setDataSize().
Referenced by filter().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 750 of file WavFile.php.
References $_bitsPerSample, and setAudioFormat().
Referenced by setBitsPerSample().
Here is the call graph for this function:
Here is the caller graph for this function:| WavFile::setWavData | ( | & | $data, |
$free = true |
|||
| ) |
Set the wav file data and properties from a wav file in a string.
| string | $data | (Required) The wav file data. Passed by reference. |
| bool | $free | (Optional) True to free the passed $data after copying. |
| WavFormatException | |
| WavFileException |
Definition at line 1011 of file WavFile.php.
References $data, closeWav(), and readWav().
Here is the call graph for this function:
|
static |
Unpacks a single binary sample to numeric value.
| string | $sampleBinary | (Required) The sample to decode. |
| int | $bitDepth | (Optional) The bits per sample to decode. If omitted, derives it from the length of $sampleBinary. |
Definition at line 289 of file WavFile.php.
References $data, and Vendor\Package\$sample.
Referenced by unpackSampleBlock().
Here is the caller graph for this function:
|
static |
Unpacks a binary sample block to numeric values.
| string | $sampleBlock | (Required) The binary sample block (all channels). |
| int | $bitDepth | (Required) The bits per sample to decode. |
| int | $numChannels | (Optional) The number of channels to decode. If omitted, derives it from the length of $sampleBlock and $bitDepth. |
Definition at line 373 of file WavFile.php.
References $i, and unpackSample().
Here is the call graph for this function:
|
protected |
Definition at line 141 of file WavFile.php.
Referenced by getActualSize().
|
protected |
Definition at line 168 of file WavFile.php.
Referenced by getAudioFormat().
|
protected |
Definition at line 171 of file WavFile.php.
Referenced by getAudioSubFormat().
|
protected |
Definition at line 183 of file WavFile.php.
Referenced by getBitsPerSample(), setSampleValue(), and setValidBitsPerSample().
|
protected |
Definition at line 189 of file WavFile.php.
Referenced by getBlockAlign(), getSampleBlock(), and setSampleBlock().
|
protected |
Definition at line 195 of file WavFile.php.
Referenced by getByteRate().
|
protected |
Definition at line 177 of file WavFile.php.
Referenced by getChannelMask().
|
protected |
Definition at line 144 of file WavFile.php.
Referenced by getChunkSize(), and setActualSize().
|
protected |
Definition at line 165 of file WavFile.php.
Referenced by getDataOffset().
|
protected |
Definition at line 156 of file WavFile.php.
Referenced by getDataSize(), and setSampleValue().
|
protected |
Definition at line 159 of file WavFile.php.
|
protected |
Definition at line 162 of file WavFile.php.
|
protected |
Definition at line 153 of file WavFile.php.
Referenced by getFactChunkSize().
|
protected |
Definition at line 147 of file WavFile.php.
Referenced by getFmtChunkSize().
|
protected |
Definition at line 150 of file WavFile.php.
Referenced by getFmtExtendedSize(), and setFmtChunkSize().
|
protected |
Definition at line 201 of file WavFile.php.
|
protected |
Definition at line 192 of file WavFile.php.
Referenced by getNumBlocks().
|
protected |
Definition at line 174 of file WavFile.php.
Referenced by getNumChannels().
|
protected |
Definition at line 180 of file WavFile.php.
Referenced by getSampleRate().
|
protected |
Definition at line 198 of file WavFile.php.
Referenced by getSamples(), and insertSilence().
|
protected |
Definition at line 186 of file WavFile.php.
Referenced by getValidBitsPerSample().
|
staticprotected |
Definition at line 133 of file WavFile.php.
| const WavFile::FILTER_DEGRADE = 0x04 |
Definition at line 81 of file WavFile.php.
Referenced by degrade(), filter(), and Securimage\generateWAV().
| const WavFile::FILTER_MIX = 0x01 |
Definition at line 75 of file WavFile.php.
Referenced by filter(), Securimage\generateWAV(), and mergeWav().
| const WavFile::FILTER_NORMALIZE = 0x02 |
Definition at line 78 of file WavFile.php.
Referenced by filter(), Securimage\generateWAV(), and mergeWav().
| const WavFile::MAX_CHANNEL = 18 |
Definition at line 84 of file WavFile.php.
| const WavFile::MAX_SAMPLERATE = 192000 |
Definition at line 87 of file WavFile.php.
| const WavFile::SPEAKER_ALL = 0x03FFFF |
Definition at line 109 of file WavFile.php.
| const WavFile::SPEAKER_BACK_CENTER = 0x000100 |
Definition at line 99 of file WavFile.php.
| const WavFile::SPEAKER_BACK_LEFT = 0x000010 |
Definition at line 95 of file WavFile.php.
| const WavFile::SPEAKER_BACK_RIGHT = 0x000020 |
Definition at line 96 of file WavFile.php.
| const WavFile::SPEAKER_DEFAULT = 0x000000 |
Channel Locations for ChannelMask.
Definition at line 90 of file WavFile.php.
Referenced by __construct().
| const WavFile::SPEAKER_FRONT_CENTER = 0x000004 |
Definition at line 93 of file WavFile.php.
| const WavFile::SPEAKER_FRONT_LEFT = 0x000001 |
Definition at line 91 of file WavFile.php.
| const WavFile::SPEAKER_FRONT_LEFT_OF_CENTER = 0x000040 |
Definition at line 97 of file WavFile.php.
| const WavFile::SPEAKER_FRONT_RIGHT = 0x000002 |
Definition at line 92 of file WavFile.php.
| const WavFile::SPEAKER_FRONT_RIGHT_OF_CENTER = 0x000080 |
Definition at line 98 of file WavFile.php.
| const WavFile::SPEAKER_LOW_FREQUENCY = 0x000008 |
Definition at line 94 of file WavFile.php.
| const WavFile::SPEAKER_SIDE_LEFT = 0x000200 |
Definition at line 100 of file WavFile.php.
| const WavFile::SPEAKER_SIDE_RIGHT = 0x000400 |
Definition at line 101 of file WavFile.php.
| const WavFile::SPEAKER_TOP_BACK_CENTER = 0x010000 |
Definition at line 107 of file WavFile.php.
| const WavFile::SPEAKER_TOP_BACK_LEFT = 0x008000 |
Definition at line 106 of file WavFile.php.
| const WavFile::SPEAKER_TOP_BACK_RIGHT = 0x020000 |
Definition at line 108 of file WavFile.php.
| const WavFile::SPEAKER_TOP_CENTER = 0x000800 |
Definition at line 102 of file WavFile.php.
| const WavFile::SPEAKER_TOP_FRONT_CENTER = 0x002000 |
Definition at line 104 of file WavFile.php.
| const WavFile::SPEAKER_TOP_FRONT_LEFT = 0x001000 |
Definition at line 103 of file WavFile.php.
| const WavFile::SPEAKER_TOP_FRONT_RIGHT = 0x004000 |
Definition at line 105 of file WavFile.php.
| const WavFile::WAVE_FORMAT_EXTENSIBLE = 0xFFFE |
Definition at line 118 of file WavFile.php.
Referenced by setAudioFormat().
| const WavFile::WAVE_FORMAT_IEEE_FLOAT = 0x0003 |
Definition at line 115 of file WavFile.php.
Referenced by setAudioFormat().
| const WavFile::WAVE_FORMAT_PCM = 0x0001 |
Definition at line 112 of file WavFile.php.
Referenced by __construct(), and setAudioFormat().
| const WavFile::WAVE_SUBFORMAT_IEEE_FLOAT = "0300000000001000800000aa00389b71" |
Definition at line 124 of file WavFile.php.
Referenced by setAudioSubFormat().
| const WavFile::WAVE_SUBFORMAT_PCM = "0100000000001000800000aa00389b71" |
Definition at line 121 of file WavFile.php.
Referenced by setAudioSubFormat().