声音皈依到频率的android [英] Sound convertion to frequency in android
问题描述
可能重复:
实时基音检测
<一href="http://stackoverflow.com/questions/3904488/determine-the-audio-frequency-of-sound-received-via-the-microphone">Determine声音的音频经由麦克风的接收
Possible Duplicate:
Real time pitch detection
Determine the audio frequency of sound received via the microphone
我发展我自己的Android的吉他调谐器。在这里,我将不得不使用吉他音符的频率。因此,我想知道如何通过MIC端口传来的声音转换成其频率在Android的?
I'm developing my own android guitar tuner. Here I will have to use the guitar note frequency. Therefore, I want to know how to convert the sound coming through the mic port into its frequency in android?
推荐答案
编辑:链接死了---这个问题已经解决了<一href="http://netscale.cse.nd.edu/twiki/pub/Main/Projects/Analyze_the_frequency_and_strength_of_sound_in_Android.pdf"相对=nofollow>这里 ---
link dead ---This problem is already solved here---
我要总结论文:
-
记录的东西:
Record stuff :
int minSize = AudioRecord.getMinBufferSize(sampleRate,AudioFormat.
CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
AudioRecord audioInput = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
minSize);
...
short[] buffer = new short[readSize];
audioInput.startRecording();
audioInput.read(buffer, index, readSize); // record data from mic into buffer
使用FFT Anayze频率。
Anayze the frequency using FFT.
我说你录制应用FFT就可以了约4秒。像hotpaw2说你必须使用间距估计算法来确定录制的声音从乱弹的频率范围。
I'd say you record about 4 seconds of apply FFT on it. Like hotpaw2 says you have to use pitch estimation algorithms to determine the range of frequencies in recorded sound from the strum.
这篇关于声音皈依到频率的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!