声音皈依到频率的android频率、声音、android

2023-09-06 06:37:55 作者:隐身守侯

可能重复:   实时基音检测   Determine声音的音频经由麦克风的接收

Possible Duplicate: Real time pitch detection Determine the audio frequency of sound received via the microphone

我发展我自己的Andr​​oid的吉他调谐器。在这里,我将不得不使用吉他音符的频率。因此,我想知道如何通过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?

推荐答案

编辑:链接死了---这个问题已经解决了这里 ---

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频率。

爆 苹果iOS程序崩溃率高于Android

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.