All Projects → SIY1121 → WaveFormViewDemo

SIY1121 / WaveFormViewDemo

Licence: Apache-2.0 License
Provides a view to display audio waveforms.

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to WaveFormViewDemo

songturtle
🐢 Play, slow down, and loop sections of audio files in the browser 🐢
Stars: ✭ 26 (-33.33%)
Mutual labels:  audio-visualizer
RecPlayer-iOS
A simple iOS application that records audio and plays it back. (+some animations)
Stars: ✭ 21 (-46.15%)
Mutual labels:  audio-visualizer
iiVisu
A player/ recorder visualizer with the swipe to seek functionality.
Stars: ✭ 112 (+187.18%)
Mutual labels:  audio-visualizer
RGB Audio Backlight
Arduino Sketch for controlling WS2812 RGB Led Strip + Audio Visualizer
Stars: ✭ 19 (-51.28%)
Mutual labels:  audio-visualizer
barva
An audio visualizer that pulses the background of your terminal (or anything else).
Stars: ✭ 101 (+158.97%)
Mutual labels:  audio-visualizer
modular-led-controller-workstation
🎵 🌈 Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
Stars: ✭ 21 (-46.15%)
Mutual labels:  audio-visualizer
qxresearch-event-1
10+ Python Application 🦾 | 10- lines of code 👽
Stars: ✭ 194 (+397.44%)
Mutual labels:  audio-visualizer
audio-waveform-svg-path
Building path for SVG element to perform waveform view of audio file
Stars: ✭ 39 (+0%)
Mutual labels:  audio-visualizer
JetTunes-Desktop-Music-Player
Material design music player made with javafx
Stars: ✭ 36 (-7.69%)
Mutual labels:  audio-visualizer
pulseviz.py
Audio visualizer for PulseAudio written in Python
Stars: ✭ 24 (-38.46%)
Mutual labels:  audio-visualizer
Comet
Web Synthesis on steroids
Stars: ✭ 18 (-53.85%)
Mutual labels:  audio-visualizer
QuietVR
A Quiet Place in VR: Generate any 3D object with your voice. It's magic!
Stars: ✭ 17 (-56.41%)
Mutual labels:  audio-visualizer
vue-dictaphone
🎙️ Vue.js dictaphone component to record audio from the user
Stars: ✭ 22 (-43.59%)
Mutual labels:  audio-visualizer
wav2bar
Wav2Bar is a tool to make custom audio visualization and export production videos for the audio and music industry.
Stars: ✭ 35 (-10.26%)
Mutual labels:  audio-visualizer
visualizer2
OpenGL Audio Visualizers in Rust
Stars: ✭ 54 (+38.46%)
Mutual labels:  audio-visualizer
ModularMusicVisualizer
Project in Hiatus, unmaintained, being rewritten privately. Will Open Source when stuff is ready. Project will be Renamed.
Stars: ✭ 81 (+107.69%)
Mutual labels:  audio-visualizer
audiovisualizer
Another simple audio visualizer for android.
Stars: ✭ 33 (-15.38%)
Mutual labels:  audio-visualizer
webgl-3d-animation
An interactive 3D animation using WebGL to depict a 2D predator prey ecology on a grid real-time mapped onto the surface of a 3D torus. Sound file is parsed then visualized both in time and frequency domains as well as rendered using Web Audio API - this is an exercise where I taught myself how to display data for an ongoing project on sound syn…
Stars: ✭ 23 (-41.03%)
Mutual labels:  audio-visualizer
koch fractals
Koch Fractals Demo for Unity
Stars: ✭ 31 (-20.51%)
Mutual labels:  audio-visualizer
Amplituda
Amlituda - an android library that calculates amplitudes from audio and provides data in different formats. Based on this data, you can draw waveform. Android audio amplitude library.
Stars: ✭ 75 (+92.31%)
Mutual labels:  audio-visualizer

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].