kandi background
Explore Kits

android-audio-visualizer | Audio visualisation for android MediaPlayer | Audio Utils library

 by   GautamChibde Java Version: 2.2.0 License: Apache-2.0

 by   GautamChibde Java Version: 2.2.0 License: Apache-2.0

Download this library from

kandi X-RAY | android-audio-visualizer Summary

android-audio-visualizer is a Java library typically used in Audio, Audio Utils applications.,roid-audio-visualizer has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.
<h1 align="center"> <img src="http://res.cloudinary.com/dvkxfgprc/image/upload/v1511626276/logo_lfjxrd.png"></h1>. [![Build Status](https://travis-ci.com/GautamChibde/android-audio-visualizer.svg?branch=master)](https://travis-ci.org/GautamChibde/android-audio-visualizer) [![codebeat badge](https://codebeat.co/badges/0f34e433-9e0b-44a4-90da-b53d644848b9)](https://codebeat.co/projects/github-com-gautamchibde-android-audio-visualizer-master) [ ![Download](https://api.bintray.com/packages/gautamchibde/Audio-Visualizer/audiovisualizer/images/download.svg) ](https://bintray.com/gautamchibde/Audio-Visualizer/audiovisualizer/_latestVersion) [![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14).
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • android-audio-visualizer has a low active ecosystem.
  • It has 529 star(s) with 115 fork(s). There are 24 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 16 open issues and 14 have been closed. On average issues are closed in 135 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of android-audio-visualizer is 2.2.0
This Library - Support
Best in #Audio Utils
Average in #Audio Utils
This Library - Support
Best in #Audio Utils
Average in #Audio Utils

quality kandi Quality

  • android-audio-visualizer has 0 bugs and 39 code smells.
This Library - Quality
Best in #Audio Utils
Average in #Audio Utils
This Library - Quality
Best in #Audio Utils
Average in #Audio Utils

securitySecurity

  • android-audio-visualizer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • android-audio-visualizer code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
This Library - Security
Best in #Audio Utils
Average in #Audio Utils
This Library - Security
Best in #Audio Utils
Average in #Audio Utils

license License

  • android-audio-visualizer is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
This Library - License
Best in #Audio Utils
Average in #Audio Utils
This Library - License
Best in #Audio Utils
Average in #Audio Utils

buildReuse

  • android-audio-visualizer releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • android-audio-visualizer saves you 561 person hours of effort in developing the same functionality from scratch.
  • It has 1312 lines of code, 117 functions and 40 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
This Library - Reuse
Best in #Audio Utils
Average in #Audio Utils
This Library - Reuse
Best in #Audio Utils
Average in #Audio Utils
Top functions reviewed by kandi - BETA

kandi has reviewed android-audio-visualizer and discovered the below as its top functions. This is intended to give you an instant insight into android-audio-visualizer implemented functionality, and help decide if they suit your requirements.

  • Invoked when the bar is drawn .
    • This method is called when the request has been granted .
      • Initialize the visualizer .
        • Release the graphics context .
          • Start the media player service .
            • Sets the density .
              • Set the stroke width .
                • Starts the media stream .
                  • Sets the activity to be saved .
                    • Sets the radius multiplier .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      android-audio-visualizer Key Features

                      :musical_score: :musical_keyboard: :musical_note: Audio visualisation for android MediaPlayer :sound:

                      android-audio-visualizer Examples and Code Snippets

                      See all related Code Snippets

                      Importing the Library

                      copy iconCopydownload iconDownload
                      dependencies {
                          compile 'com.chibde:audiovisualizer:2.2.0'
                      }

                      How to use

                      copy iconCopydownload iconDownload
                      Refer to the [sample](https://github.com/GautamChibde/android-audio-visualizer/tree/master/sample) project on how to use visualizer or refer to [WIKI](https://github.com/GautamChibde/android-audio-visualizer/wiki) docs.

                      License

                      copy iconCopydownload iconDownload
                      http://www.apache.org/licenses/LICENSE-2.0

                      How to visualize an audio file in an android app using Android Studio?

                      copy iconCopydownload iconDownload
                       public void init(){
                          Log.d(TAG, "init: init() called");
                          LineVisualizer lineVisualizer = findViewById(R.id.lineVisualizer);
                          // set custom color to the line.
                          lineVisualizer.setColor(ContextCompat.getColor(this, R.color.custom));
                          // set the line with for the visualizer between 1-10 default 1.
                          lineVisualizer.setStrokeWidth(1);
                          // Set you media player to the visualizer.
                          lineVisualizer.setPlayer(mediaPlayer.getAudioSessionId());  //Added session ID
                      }
                      

                      See all related Code Snippets

                      Community Discussions

                      Trending Discussions on android-audio-visualizer
                      • How to visualize an audio file in an android app using Android Studio?
                      Trending Discussions on android-audio-visualizer

                      QUESTION

                      How to visualize an audio file in an android app using Android Studio?

                      Asked 2019-Jul-30 at 18:57

                      I am trying to visualize an file in android.I am using the following library to do it com.chibde:audiovisualizer:2.1.0. But my app crashes saying

                      java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -3 at android.media.audiofx.Visualizer

                      I have written this code by reading this blog https://mindorks.com/android/store/Equalizers-and-Visualizations/gautamchibde/android-audio-visualizer.

                      The following is my MainActivity.java

                      public class MainActivity extends AppCompatActivity {
                      
                          ImageButton playPauseBtn;
                          private static final String TAG = "MainActivity";
                          MediaPlayer mediaPlayer;
                      
                          @Override
                          protected void onCreate(Bundle savedInstanceState) {
                              super.onCreate(savedInstanceState);
                              setContentView(R.layout.activity_main);
                              playPauseBtn = (ImageButton) findViewById(R.id.ib_play_pause);
                              setPlayer();
                          }
                          public void playPause(View view){
                              if(mediaPlayer != null){
                                  if(mediaPlayer.isPlaying()){
                                      mediaPlayer.pause();
                                      playPauseBtn.setImageDrawable(ContextCompat.getDrawable(this,R.drawable.ic_play_red_48dp));
                                  }
                                  else
                                  {
                                      mediaPlayer.start();
                                      playPauseBtn.setImageDrawable(ContextCompat.getDrawable(this,R.drawable.ic_pause_red_48dp));
                                  }
                              }
                          }
                      
                          public void setPlayer(){
                              Log.d(TAG, "setPlayer: setPlayer() called");
                              mediaPlayer = MediaPlayer.create(this,R.raw.normal);
                              mediaPlayer.setLooping(false);
                              init();
                          }
                      
                          public void init(){
                              Log.d(TAG, "init: init() called");
                              LineVisualizer lineVisualizer = findViewById(R.id.lineVisualizer);
                              // set custom color to the line.
                              lineVisualizer.setColor(ContextCompat.getColor(this, R.color.custom));
                              // set the line with for the visualizer between 1-10 default 1.
                              lineVisualizer.setStrokeWidth(1);
                              // Set you media player to the visualizer.
                              lineVisualizer.setPlayer(mediaPlayer);
                          }
                      }
                      

                      //The following is my ActivityMain.xml

                      <?xml version="1.0" encoding="utf-8"?>
                      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                          xmlns:app="http://schemas.android.com/apk/res-auto"
                          xmlns:tools="http://schemas.android.com/tools"
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:orientation="vertical"
                          tools:context="com.techmate.asifa.waves.MainActivity">
                      
                         <com.chibde.visualizer.LineVisualizer
                             android:layout_width="match_parent"
                             android:layout_height="250dp"
                             android:id="@+id/lineVisualizer"/>
                      
                      
                          <include layout="@layout/layout_audio_buttons"/>
                      
                      </LinearLayout>
                      

                      the following is my gradle

                      apply plugin: 'com.android.application'
                      
                      android {
                          compileSdkVersion 28
                          buildToolsVersion "29.0.0"
                          defaultConfig {
                              applicationId "com.techmate.asifa.waves"
                              minSdkVersion 19
                              targetSdkVersion 28
                              versionCode 1
                              versionName "1.0"
                              testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
                          }
                          buildTypes {
                              release {
                                  minifyEnabled false
                                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                              }
                          }
                      }
                      
                      dependencies {
                          compile fileTree(dir: 'libs', include: ['*.jar'])
                          androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
                              exclude group: 'com.android.support', module: 'support-annotations'
                          })
                          compile 'com.android.support:appcompat-v7:28.+'
                          compile 'com.android.support.constraint:constraint-layout:1.0.2'
                          compile 'com.chibde:audiovisualizer:2.1.0'
                          testCompile 'junit:junit:4.12'
                      }
                      

                      My app crashes when i run it and the following error is shown in my logcat

                      Caused by: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -3
                          at android.media.audiofx.Visualizer.<init>(Visualizer.java:218)
                          at com.chibde.BaseVisualizer.setPlayer(BaseVisualizer.java:81)
                          at com.chibde.BaseVisualizer.setPlayer(BaseVisualizer.java:77)
                          at com.techmate.asifa.waves.MainActivity.init(MainActivity.java:81)
                          at com.techmate.asifa.waves.MainActivity.setPlayer(MainActivity.java:66)
                          at com.techmate.asifa.waves.MainActivity.onCreate(MainActivity.java:32)
                          at android.app.Activity.performCreate(Activity.java:7009)
                          at android.app.Activity.performCreate(Activity.java:7000)
                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
                          at android.app.ActivityThread.-wrap11(Unknown Source:0) 
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
                          at android.os.Handler.dispatchMessage(Handler.java:106) 
                          at android.os.Looper.loop(Looper.java:164) 
                          at android.app.ActivityThread.main(ActivityThread.java:6494)
                      

                      ANSWER

                      Answered 2019-Jul-22 at 10:23

                      Try doing this, it appeared that you were not supplying audio session ID to the visualizer.

                       public void init(){
                          Log.d(TAG, "init: init() called");
                          LineVisualizer lineVisualizer = findViewById(R.id.lineVisualizer);
                          // set custom color to the line.
                          lineVisualizer.setColor(ContextCompat.getColor(this, R.color.custom));
                          // set the line with for the visualizer between 1-10 default 1.
                          lineVisualizer.setStrokeWidth(1);
                          // Set you media player to the visualizer.
                          lineVisualizer.setPlayer(mediaPlayer.getAudioSessionId());  //Added session ID
                      }
                      

                      Source https://stackoverflow.com/questions/57143656

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install android-audio-visualizer

                      You can download it from GitHub.
                      You can use android-audio-visualizer like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the android-audio-visualizer component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Reuse Pre-built Kits with android-audio-visualizer
                      Consider Popular Audio Utils Libraries
                      Try Top Libraries by GautamChibde
                      Compare Audio Utils Libraries with Highest Support
                      Compare Audio Utils Libraries with Highest Quality
                      Compare Audio Utils Libraries with Highest Security
                      Compare Audio Utils Libraries with Permissive License
                      Compare Audio Utils Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.