Waveformviewdemo

Provides a view to display audio waveforms.
Alternatives To Waveformviewdemo
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Waveform Playlist1,297449 months ago54February 26, 202240mitJavaScript
Multitrack Web Audio editor and player with canvas waveform preview. Set cues, fades and shift multiple tracks in time. Record audio tracks or provide audio annotations. Export your mix to AudioBuffer or WAV! Add effects from Tone.js. Project inspired by Audacity.
Dswaveformimage817
17 days ago11January 24, 20201mitSwift
Generate waveform images from audio files on iOS, macOS & visionOS in Swift. Native SwiftUI & UIKit views.
Videojs Wavesurfer327231210 months ago82October 03, 202211mitJavaScript
video.js plugin that adds a navigable waveform for audio and video files
Mpv Scripts124
4 months ago11unlicenseLua
mpv lua scripts
Wavesurfer React12442 days ago51November 28, 20235mitTypeScript
A simple React wrapper for wavesurfer.js
Amplituda121
10 months ago4apache-2.0C
Amlituda - an android audio processing library, which provides waveform data
Awesome Web Audio83
2 years ago10mit
A list of resources and projects to help learn about audio
Audio Oscilloscope48323 years ago7November 14, 2020mitJavaScript
:musical_note: Waveform audio visualizer for the HTML5 canvas.
Audio Waveform Svg Path2726 years ago3June 06, 2017mitJavaScript
Building path for SVG element to perform waveform view of audio file
Waveformviewdemo22
5 years ago2apache-2.0Kotlin
Provides a view to display audio waveforms.
Alternatives To Waveformviewdemo
Select To Compare


Alternative Project Comparisons
Readme

WaveFormView

WaveFormView provides a view to display audio waveforms.

Generating waveforms at runtime, you don't have to prepare data in advance.

Note : It takes a few seconds to generate

Screenshots

Importing the Library

Add the following dependicity to your build.gradle file.

dependencies {
    repositories {
        jcenter()
    }
    compile 'space.siy:waveformview:1.0.0'
}

Usage

You can see full code at MainActivity.kt

//Open From Assets Folder
val afd = assets.openFd("jazz_in_paris.mp3")

//Build WaveFormData
WaveFormData.Factory(afd.fileDescriptor, afd.startOffset, afd.length)
        .build(object : WaveFormData.Factory.Callback {
            //When Complete, you can receive data and set to the view
            override fun onComplete(waveFormData: WaveFormData) {
                waveFormView.data = waveFormData

                //Initialize MediaPlayer
                val player = MediaPlayer()
                player.setDataSource(afd.fileDescriptor, afd.startOffset, afd.length)
                player.prepare()
                player.start()

                //Synchronize with MediaPlayer using WaveFormView.Callback
                waveFormView.callback = object : WaveFormView.Callback {
                    override fun onPlayPause() {
                        if (player.isPlaying)
                            player.pause()
                        else
                            player.start()
                    }
                    override fun onSeek(pos: Long) {
                        player.seekTo(pos.toInt())
                    }
                }

                //You have to notify current position to the view
                Handler().postDelayed(object : Runnable {
                    override fun run() {
                        waveFormView.position = player.currentPosition.toLong()
                        Handler().postDelayed(this, 20)
                    }
                }, 20)

            }

            override fun onProgress(progress: Float) {
                progressBar.progress = (progress*10).toInt()
            }
        })

Customization

You can change block style via xml and program.

The following xml shows all attributes.

<space.siy.waveformview.WaveFormView
        android:id="@+id/waveFormView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:blockColor="@color/white"
        app:blockColorPlayed="@color/red"
        app:showTimeText="true"
        app:textColor="@color/white"
        app:textBgColor="@color/black"
        app:blockWidth="10"
        app:topBlockScale="1"
        app:bottomBlockScale="0.5"
        app:peakMode="peakmode_average"
        app:secPerBlock="0.1" />

Document

See here.

Requirement

Supports Android 5.0+

WaveFormView uses MediaCodec supporting 5.0+ to generate waveform at runtime.

Lisence

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Popular Waveform Projects
Popular Audio Visualizer Projects
Popular Media Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Kotlin
Xml
Kotlin Android
Waveform
Audio Visualizer