How to create oscilloscope for audio on android -
i creating app audio recording oscilloscope. did audio recording following code add oscilloscopse shown in figure.my requirement oscilloscope's wave should zigzac according user's voice tone. have tried long time not find solution. not have idea implement oscilloscope. please me how , please provide sample code snippets. thanks.
audio recording 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 simple answer this, it's going take work on part process it. here few links should able started:
http://code.google.com/p/musicg/
http://codeidol.com/java/swing/audio/build-an-audio-waveform-display/
Comments
Post a Comment