문제

I have an array of 8-bit values which I have received from a microprocessor.
I am looking to turn those values into a wav file using PHP.

I found some examples, like this or this, that work in Java and C# but they all seem to leverage existing classes. Does anyone know of a PHP library that can do this? If not, can someone explain how to create a wav file in PHP?

도움이 되었습니까?

해결책

You can use pack function, but first you must discover what values used: signed or unsigned

function pack_array($v,$a) {
 return call_user_func_array(pack,array_merge(array($v),(array)$a));
}

$wav = pack_array('c*', $array); // 'C*' for unsigned
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top