jhuster / audiodemo Goto Github PK
View Code? Open in Web Editor NEWAudio API demo on Android platform
Audio API demo on Android platform
public boolean openFile(String filepath, int sampleRateInHz, int channels, int bitsPerSample) throws IOException {
if (mDataOutputStream != null) {
closeFile();
}
mFilepath = filepath;
mDataSize = 0;
mDataOutputStream = new DataOutputStream(new FileOutputStream(filepath));
return writeHeader(sampleRateInHz, bitsPerSample, channels);
}
private boolean writeHeader(int sampleRateInHz, int channels, int bitsPerSample) {
}
这里调用writeHeader函数输入参数有问题
1、WavFileWriter.java
37行: return writeHeader(sampleRateInHz,bitsPerSample,channels);
应为: return writeHeader(sampleRateInHz,channels,bitsPerSample);
2、WavFileHeader.java
19行: public static final int WAV_CHUNKSIZE_EXCLUDE_DATA = 36;
应为: public static final int WAV_CHUNKSIZE_EXCLUDE_DATA = 32;
java.io.FileNotFoundException: /storage/emulated/0/test.wav (No such file or directory)
请问提示没找到文件是因为什么呢
博主你好,我发现不管使用AudioRecord、MediaRecorder还是OpenSL es录音声音都很小,请问这个录音的时候需要设置麦克风的输入音量大小调吗,还是说需要其他的库来增益
现在有个问题,我找了一些wav格式的歌曲文件来测试,发现data的位置不是固定的,但是一定在BitsPerSample标签后面,SubChunk2Size标签之前。所以大师,你的代码要修复一下,要不有些wav格式的歌曲,获取到的SubChunk2Size信息是错误的。
谢谢~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.