如何创建示波器音频在Android [英] How to create oscilloscope for audio on android

查看:209
本文介绍了如何创建示波器音频在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的录音与示波器的应用程序。我做了音频录制以下$ C $现在C I加oscilloscopse如图所示figure.my要求是示波器的波形应根据用户的语音语调是zigzac。我已经尝试过很长一段时间,但我找不到解决办法。我没有任何想法来实现示波器。请帮我如何做到这一点,并请提供一些样品code片段。谢谢。

i am creating an app for audio recording with oscilloscope. i did the audio recording with the following code now i add oscilloscopse as shown in the figure.my requirement is oscilloscope's wave should be zigzac according to the user's voice tone. i have tried long time but i could not find solution. i do not have any idea to implement the oscilloscope. please help me how to do it and please provide some sample code snippets. thanks.

录音code:

    recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,RECORDER_SAMPLERATE, RECORDER_CHANNELS,RECORDER_AUDIO_ENCODING, bufferSize);

    recorder.startRecording();
...

    byte data[] = new byte[bufferSize];
    String filename = getTempFilename();
    FileOutputStream outputstream = null;
    try {
        outputstream = new FileOutputStream(filename, true);
    } catch (FileNotFoundException e) {
        Log.e("Error @ writeAudioDataToFile() - 1 ", e.getMessage());
    }

    int read = 0;

    if (null != outputstream) {
        while (isRecording) {
            read = recorder.read(data, 0, bufferSize);

            if (AudioRecord.ERROR_INVALID_OPERATION != read) {
                try {
                    outputstream.write(data);
                } catch (IOException e) {
                    Log.e("Error @ writeAudioDataToFile() - 2 ",e.getMessage());
                }
            }
        }

        try {
            outputstream.close();
        } catch (IOException e) {
            Log.e("Error @ writeAudioDataToFile() - 3 ", e.getMessage());
        }
    }

推荐答案

有没有真正的这是一个简单的答案,这将肯定承担你做一些工作来处理它。这里有一些链接,应该能够帮助您入门:

There's not really a simple answer for this, it's going to definitely take some work on your part to process it. Here are a few links that should be able to get you started:

HTTP://$c$c.google.com/p/musicg/

的http:// codeidol .COM /爪哇/秋千/音频/内建的音频波形,显示/

这篇关于如何创建示波器音频在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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