本文整理匯總了PHP中getid3_riff::RIFFwFormatTagLookup方法的典型用法代碼示例。如果您正苦於以下問題:PHP getid3_riff::RIFFwFormatTagLookup方法的具體用法?PHP getid3_riff::RIFFwFormatTagLookup怎麽用?PHP getid3_riff::RIFFwFormatTagLookup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類getid3_riff
的用法示例。
在下文中一共展示了getid3_riff::RIFFwFormatTagLookup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: RIFFparseWAVEFORMATex
function RIFFparseWAVEFORMATex($WaveFormatExData)
{
// shortcut
$WaveFormatEx['raw'] = array();
$WaveFormatEx_raw =& $WaveFormatEx['raw'];
$WaveFormatEx_raw['wFormatTag'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 0, 2));
$WaveFormatEx_raw['nChannels'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 2, 2));
$WaveFormatEx_raw['nSamplesPerSec'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 4, 4));
$WaveFormatEx_raw['nAvgBytesPerSec'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 8, 4));
$WaveFormatEx_raw['nBlockAlign'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 12, 2));
$WaveFormatEx_raw['wBitsPerSample'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 14, 2));
if (strlen($WaveFormatExData) > 16) {
$WaveFormatEx_raw['cbSize'] = getid3_lib::LittleEndian2Int(substr($WaveFormatExData, 16, 2));
}
$WaveFormatEx['codec'] = getid3_riff::RIFFwFormatTagLookup($WaveFormatEx_raw['wFormatTag']);
$WaveFormatEx['channels'] = $WaveFormatEx_raw['nChannels'];
$WaveFormatEx['sample_rate'] = $WaveFormatEx_raw['nSamplesPerSec'];
$WaveFormatEx['bitrate'] = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8;
$WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample'];
return $WaveFormatEx;
}
示例2: RIFFparseWAVEFORMATex
public static function RIFFparseWAVEFORMATex($wave_format_ex_data)
{
$wave_format_ex['raw'] = array();
$wave_format_ex_raw =& $wave_format_ex['raw'];
getid3_lib::ReadSequence('LittleEndian2Int', $wave_format_ex_raw, $wave_format_ex_data, 0, array('wFormatTag' => 2, 'nChannels' => 2, 'nSamplesPerSec' => 4, 'nAvgBytesPerSec' => 4, 'nBlockAlign' => 2, 'wBitsPerSample' => 2));
if (strlen($wave_format_ex_data) > 16) {
$wave_format_ex_raw['cbSize'] = getid3_lib::LittleEndian2Int(substr($wave_format_ex_data, 16, 2));
}
$wave_format_ex['codec'] = getid3_riff::RIFFwFormatTagLookup($wave_format_ex_raw['wFormatTag']);
$wave_format_ex['channels'] = $wave_format_ex_raw['nChannels'];
$wave_format_ex['sample_rate'] = $wave_format_ex_raw['nSamplesPerSec'];
$wave_format_ex['bitrate'] = $wave_format_ex_raw['nAvgBytesPerSec'] * 8;
if (@$wave_format_ex_raw['wBitsPerSample']) {
$wave_format_ex['bits_per_sample'] = $wave_format_ex_raw['wBitsPerSample'];
}
return $wave_format_ex;
}