Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用ffmpeg从mp3转过来的wav文件,读取异常 #2

Open
JqiangLiu opened this issue Mar 15, 2019 · 6 comments
Open

用ffmpeg从mp3转过来的wav文件,读取异常 #2

JqiangLiu opened this issue Mar 15, 2019 · 6 comments

Comments

@JqiangLiu
Copy link

转过来的wav文件8/16bit 单声道的。在
this.datasubchunk = readString(WaveConstants.LENDATASUBCHUNK); // datasubchunk值是“LIST”
if (!datasubchunk.endsWith("data"))
抛异常了。

@Sickle2
Copy link

Sickle2 commented Oct 30, 2019

需要对list进行解析,list的大小是后2位 int listsize = readInt(); data可以再listsize +2后的数据中取出来

@zuoni1018
Copy link

不明白

@Sickle2
Copy link

Sickle2 commented Nov 25, 2019

有的数据在data前还有一个字段,是list,可以自己查看下

@zuoni1018
Copy link

想咨询下的是这个Y轴代表的 音量 还是什么?

@Sickle2
Copy link

Sickle2 commented Nov 26, 2019

这个生成的波形图可以说和音量关系最大吧

@kytrun
Copy link

kytrun commented Sep 6, 2022

按照 @Sickle2 的方案在https://github.com/sintrb/WaveAccess/blob/master/src/com/sin/java/waveaccess/WaveFileReader.java#L96
下添加

if (datasubchunk.endsWith("LIST")) {
   int listSize = readInt();
   readBytes(listSize + 2);
   this.datasubchunk = readString(WaveConstants.LENDATASUBCHUNK);
}

似乎可行,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants