24 lines
380 B
PHP
24 lines
380 B
PHP
<?php
|
|
|
|
class SamplerateFormatter {
|
|
|
|
/**
|
|
* @string sample rate
|
|
*/
|
|
private $_samplerate;
|
|
|
|
/*
|
|
* @param string $samplerate Hz
|
|
*/
|
|
public function __construct($samplerate)
|
|
{
|
|
$this->_samplerate = $samplerate;
|
|
}
|
|
|
|
public function format()
|
|
{
|
|
$kHz = bcdiv($this->_samplerate, 1000, 1);
|
|
|
|
return "{$kHz} kHz";
|
|
}
|
|
} |