{"id":15130499,"url":"https://github.com/cleveroad/waveinapp","last_synced_at":"2025-05-15T07:06:51.169Z","repository":{"id":57727640,"uuid":"51443531","full_name":"Cleveroad/WaveInApp","owner":"Cleveroad","description":"Live Audio Equalizer with wave effect","archived":false,"fork":false,"pushed_at":"2023-03-18T14:08:09.000Z","size":6918,"stargazers_count":1792,"open_issues_count":9,"forks_count":320,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-05-15T07:06:44.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.cleveroad.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cleveroad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-02-10T13:44:54.000Z","updated_at":"2025-05-06T22:28:14.000Z","dependencies_parsed_at":"2022-09-26T21:51:25.164Z","dependency_job_id":"3f10148e-d8db-497b-91ce-605cc8cffba9","html_url":"https://github.com/Cleveroad/WaveInApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FWaveInApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FWaveInApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FWaveInApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FWaveInApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cleveroad","download_url":"https://codeload.github.com/Cleveroad/WaveInApp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T03:00:50.294Z","updated_at":"2025-05-15T07:06:46.160Z","avatar_url":"https://github.com/Cleveroad.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WaveInApp [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) \u003cimg src=\"https://www.cleveroad.com/public/comercial/label-android.svg\" height=\"20\"\u003e \u003ca href=\"https://www.cleveroad.com/?utm_source=github\u0026utm_medium=label\u0026utm_campaign=contacts\"\u003e\u003cimg src=\"https://www.cleveroad.com/public/comercial/label-cleveroad.svg\" height=\"20\"\u003e\u003c/a\u003e\n![Header image](/images/header.jpg)\n\n## Welcome to WaveInApp - Audio Visualization View with wave effect.\n\nOur library can take audio from any source (audio players, streams, voice input) and animate it with high frame rate. Cool animation, designed specially for the library, responds to sound vibrations. The animation becomes intense when music plays, and once it is paused or stopped – waves calm down.\n\nThe library is a part of implementation of \u003ca href=\"https://dribbble.com/shots/2369760-Player-Concept\"\u003emusic player\u003c/a\u003e.\n\u003cbr/\u003e\n\n![Demo image](/images/demo_.gif)\n\n\nGreat visualization can spruce up any app, especially audio player. We suggest you smart and good-looking Audio Visualization View for your Android app. You can read about all the advantages this library has and find out how to implement it into your app in our blog post: \u003cb\u003e\u003ca href=\"https://www.cleveroad.com/blog/case-study-audio-visualization-view-for-android-by-cleveroad\"\u003eCase Study: Audio Visualization View For Android by Cleveroad\u003c/a\u003e\u003c/b\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n\n[![Article image](/images/article.jpg)](https://www.cleveroad.com/blog/case-study-audio-visualization-view-for-android-by-cleveroad)\n\u003cbr/\u003e\u003cbr/\u003e\n[![Awesome](/images/logo-footer.png)](https://www.cleveroad.com/?utm_source=github\u0026utm_medium=label\u0026utm_campaign=contacts)\n\u003cbr/\u003e\n\n## Setup and usage\n\nTo include this library to your project add dependency in **build.gradle** file:\n\n```groovy\n    dependencies {\n        implementation 'com.cleveroad:audiovisualization:1.0.1'\n    }\n```\n\nAudio visualization view uses OpenGL ES 2.0 for drawing waves. So you need to include this line in your manifest:\n\n```XML        \n    \u003cuses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" /\u003e\n```\n\n##### Using VisualizerDbmHandler\n\nAll functionality of this handler built upon [Visualizer] object, so you also need to include this permissions in your manifest:\n\n```XML\n    \u003cuses-permission android:name=\"android.permission.RECORD_AUDIO\"/\u003e\n    \u003cuses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/\u003e\n```\n\n##### Using SpeechRecognizerDbmHandler\n\nAll functionality of this handler built upon [SpeechRecognizer] object, so you also need to include this permissions in your manifest:\n\n```XML\n    \u003cuses-permission android:name=\"android.permission.RECORD_AUDIO\"/\u003e\n```\n\nYou must be very careful with new [Android M permissions] flow. Make sure you have all necessary permissions before using **GLAudioVisualizationView**.\n\nThere are two ways to include **GLAudioVisualizationView** in your layout: directly in XML layout file or using builder in Java code.\n\nVia XML:\n\n```XML\n    \u003ccom.cleveroad.audiovisualization.GLAudioVisualizationView\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/visualizer_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:av_bubblesSize=\"@dimen/bubble_size\"\n        app:av_bubblesRandomizeSizes=\"true\"\n        app:av_wavesHeight=\"@dimen/wave_height\"\n        app:av_wavesFooterHeight=\"@dimen/footer_height\"\n        app:av_wavesCount=\"7\"\n        app:av_layersCount=\"4\"\n        app:av_backgroundColor=\"@color/av_color_bg\"\n        app:av_bubblesPerLayer=\"16\"\n        /\u003e\n```\n\nVia Java code:\n\n```JAVA\n    new GLAudioVisualizationView.Builder(getContext())\n        .setBubblesSize(R.dimen.bubble_size)\n        .setBubblesRandomizeSize(true)\n        .setWavesHeight(R.dimen.wave_height)\n        .setWavesFooterHeight(R.dimen.footer_height)\n        .setWavesCount(7)\n        .setLayersCount(4)\n        .setBackgroundColorRes(R.color.av_color_bg)\n        .setLayerColors(R.array.av_colors)\n        .setBubblesPerLayer(16)\n        .build();\n```\n\n**GLAudioVisualizationView** implements **AudioVisualization** interface. If you don't need all [GLSurfaceView]'s public methods, you can simply cast your view to **AudioVisualization** interface and use it.\n\n```JAVA\n    private AudioVisualization audioVisualization;\n    \n    ...\n    \n    @Override\n    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {\n        super.onViewCreated(view, savedInstanceState);\n        // you can extract AudioVisualization interface for simplifying things\n        audioVisualization = (AudioVisualization) glAudioVisualizationView;\n    }\n\n    ...\n```\n\nTo connect audio visualization view to audio output you can use **linkTo(DbmHandler)** method. See **DbmHandler.Factory** class for the list of available handler implementations.\n\n```JAVA\n    // set speech recognizer handler\n    SpeechRecognizerDbmHandler speechRecHandler = DbmHandler.Factory.newSpeechRecognizerHandler(context);\n    speechRecHandler.innerRecognitionListener(...);\n    audioVisualization.linkTo(speechRecHandler);\n    \n    // set audio visualization handler. This will REPLACE previously set speech recognizer handler\n    VisualizerDbmHandler vizualizerHandler = DbmHandler.Factory.newVisualizerHandler(getContext(), 0);\n    audioVisualization.linkTo(vizualizerHandler);\n```\n\nYou must always call **onPause** method to pause visualization and stop wasting CPU resources for computations in vain. As soon as your view appears in sight of user, call **onResume**. \n\n```JAVA\n    @Override\n    public void onResume() {\n        super.onResume();\n        audioVisualization.onResume();\n    }\n    \n    @Override\n    public void onPause() {\n        audioVisualization.onPause();\n        super.onPause();\n    }\n```\n\nWhen user leaves screen with audio visualization view, don't forget to free resources and call **release()** method.\n\n```JAVA\n    @Override\n    public void onDestroyView() {\n        audioVisualization.release();\n        super.onDestroyView();\n    }\n```\n\n## Live wallpapers\nYou can use our Audio Visualization View as a live wallpaper. Just create your own [WallpaperService]. Method `onCreateEngine()` should return your own [Engine]'s implementation, in which you must override the following methods:\n* `void onCreate(SurfaceHolder surfaceHolder)` – here create instances of `DbmHandler`, `GLAudioVisualizationView.Builder` (see example below) and `GLAudioVisualizationView.AudioVisualizationRenderer` in which you must set `Engine`'s surface holder and two previous instances via `constructor(GLAudioVisualizationView.Builder)` and `handler()` methods;\n* `void onVisibilityChanged(final boolean visible)` – here you must call `onResume()` methods for audioVisualizationView and dbmHandler instances if `visible` parameter is `true`, otherwise – call `onPause()`;\n* `void onDestroy()` – just call `release()` for dbmHandler and `onDestroy()` for audioVisualizationView instances\nCheck JavaDoc of this methods for more info.\n\n```JAVA\n    public class AudioVisualizationWallpaperService extends WallpaperService {\n        @Override\n        public Engine onCreateEngine() {\n            return new WallpaperEngine();\n        }\n        \n        private class WallpaperEngine extends Engine {\n        \n        private WallpaperGLSurfaceView audioVisualizationView;\n        private DbmHandler dbmHandler;\n        private GLAudioVisualizationView.AudioVisualizationRenderer renderer;\n        ...\n            @Override\n            public void onCreate(SurfaceHolder surfaceHolder) {\n                AudioVisualizationWallpaperService context = AudioVisualizationWallpaperService.this;\n                audioVisualizationView = new WallpaperGLSurfaceView(context);\n                dbmHandler = DbmHandler.Factory.newVisualizerHandler(context, 0);\n                ...\n                GLAudioVisualizationView.Builder builder = new GLAudioVisualizationView.Builder(context)\n                        //... set your settings here (see builder example below);\n                renderer = new GLAudioVisualizationView.RendererBuilder(builder)\n                        .glSurfaceView(audioVisualizationView)\n                        .handler(dbmHandler)\n                        .build();\n                audioVisualizationView.setEGLContextClientVersion(2);\n                audioVisualizationView.setRenderer(renderer);\n            }\n            @Override\n            public void onVisibilityChanged(final boolean visible) {\n                //Please follow the next order of methods call!\n                if (visible) {\n                    audioVisualizationView.onResume();\n                    dbmHandler.onResume();\n                } else {\n                    dbmHandler.onPause();\n                    audioVisualizationView.onPause();\n                }\n            }\n            @Override\n            public void onDestroy() {\n                dbmHandler.release();\n                audioVisualizationView.onDestroy();\n            }\n         \n```\nSee uploaded [AudioVisualizationWallpaperService example].  \n\u003cbr/\u003e\n\n## Implementing your own DbmHandler\nTo implement you own data conversion handler, just extend your class from DbmHandler class and implement **onDataReceivedImpl(T object, int layersCount, float[] outDbmValues, float[] outAmpValues)** method where:\n* `object` - your custom data type\n* `layersCount` - count of layers you passed in **Builder**.\n* `outDbmValues` - array with size equals to `layersCount`. You should fill it with **normalized** dBm values for layer in range [0..1].\n* `outAmpValues` - array with size equals to `layersCount`. You should fill it with amplitude values for layer.\nCheck JavaDoc of this method for more info.\n\nThen call **onDataReceived(T object)** method to visualize your data.\n\nYour handler also will receive **onResume()**, **onPause()** and **release()** events from audio visualization view.\n\u003cbr /\u003e\n\n## Migrations\nSee all [migration manuals].\n\n## Changelog\nSee [changelog history].\n\u003cbr /\u003e\n\n## Troubleshooting\n#### Visualization\nIf you have some issues with visualization (especially on Samsung Galaxy S or HTC devices) make sure you read [this Github issue].\n#### Live wallpapers\n* If you have some issues with WaveInApp live wallpapers on Android 6.0 (and later) make sure that all next permissions are granted: `android.permission.RECORD_AUDIO`, `android.permission.MODIFY_AUDIO_SETTINGS`.\n* If you run a wallpaper selection screen when the permissions was not granted, the wallpaper will not be appear. You must open settings screen and allow all permissions. If the wallpaper is not yet appeared, just restart the wallpaper selection screen.\n\u003cbr /\u003e\n\n## Support\nIf you have any other questions regarding the use of this library, please contact us for support at info@cleveroad.com (email subject: \"Android visualization view. Support request.\") \n\u003cbr /\u003e\n\n## License\n* * *\n    The MIT License (MIT)\n    \n    Copyright (c) 2016 Cleveroad Inc.\n    \n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n    \n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n\n[migration manuals]: /MIGRATION.md\n[changelog history]: /CHANGELOG.md\n[AudioVisualizationWallpaperService example]: wallpaper/src/main/java/com/cleveroad/wallpaper/AudioVisualizationWallpaperService.java\n[WallpaperService]: https://developer.android.com/reference/android/service/wallpaper/WallpaperService.html\n[this Github issue]: https://github.com/felixpalmer/android-visualizer/issues/5#issuecomment-25900391\n[Engine]: https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html\n[Visualizer]: http://developer.android.com/intl/ru/reference/android/media/audiofx/Visualizer.html\n[SpeechRecognizer]: http://developer.android.com/intl/ru/reference/android/speech/SpeechRecognizer.html\n[Android M permissions]: http://developer.android.com/intl/ru/training/permissions/requesting.html\n[GLSurfaceView]: http://developer.android.com/intl/ru/reference/android/opengl/GLSurfaceView.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleveroad%2Fwaveinapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleveroad%2Fwaveinapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleveroad%2Fwaveinapp/lists"}