如何使用Java和不使用javax.sound来确定8bit WAV文件是否已签名 [英] How to determine if 8bit WAV File is signed or unsigned, using Java and without javax.sound

查看:98
本文介绍了如何使用Java和不使用javax.sound来确定8bit WAV文件是否已签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过仅读取文件来知道8bits的".wav"是带符号的还是无符号的PCM.我不能使用"javax.sound.sampled.*"或AudioSystem库.

I need to know whether a ".wav" of 8bits, is signed or unsigned PCM, by only reading file. I cannot use "javax.sound.sampled.*" or AudioSystem libraries.

推荐答案

在wav文件中,8位样本存储为无符号字节,范围为0到255.16位样本以带符号的整数形式存储在2的补码中.

In the wav File, 8-bit samples are stored as unsigned bytes, ranging from 0 to 255. The 16-bit samples are stored as signed integers in 2's-complement.

这篇关于如何使用Java和不使用javax.sound来确定8bit WAV文件是否已签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆