Need help with WaveformControl?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

newventuresoftware
214 Stars 67 Forks 13 Commits 4 Opened issues

Description

Android Waveform control

Services available

!
?

Need anything else?

Contributors list

WaveformView

Interface for displaying audio data as waveform for Android.

alt tag

The component supports 2 modes: * Recording: Suitable for use when recording audio. * Playback: Suitable for use when playing audio. Samples are displayed as a classical waveform with optional playback indicator.

Examples:

Recording Example:

activity_main.xml

xml

MainActivity.java
java
mRealtimeWaveformView = (WaveformView) findViewById(R.id.waveformView);
mRecordingThread = new RecordingThread(new AudioDataReceivedListener() {
    @Override
    public void onAudioDataReceived(short[] data) {
        mRealtimeWaveformView.setSamples(data);
    }
});

Playback Example:

activity_main.xml

xml

MainActivity.java
java
final WaveformView mPlaybackView = (WaveformView) findViewById(R.id.playbackWaveformView);
mPlaybackThread = new PlaybackThread(samples, new PlaybackListener() {
    @Override
    public void onProgress(int progress) {
        mPlaybackView.setMarkerPosition(progress);
    }
    @Override
    public void onCompletion() {
        mPlaybackView.setMarkerPosition(mPlaybackView.getAudioLength());
    }
});
mPlaybackView.setChannels(1);
mPlaybackView.setSampleRate(44100);
mPlaybackView.setSamples(samples);

For more information on recording and playback of raw audio in Android check out my blog post.

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.