Git Product home page Git Product logo

Comments (10)

gauravk95 avatar gauravk95 commented on August 17, 2024

It can be used for audio recording too, for that you can use setRawAudioBytes(byte[])

Yes, you guessed it right. Actually, this library is based on Visualizer class in audiofx, and Microphone permissions are required by it.
https://developer.android.com/reference/android/media/audiofx/Visualizer

Hope this answers your question!

from audio-visualizer-android.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

I don't understand. If it's not needed, why request the permission? What is the purpose of the permission, if it already has all the data within the audio file?

Can you please put into the sample of how to make it work with the recorder, as you record and maybe also before you record (meaning when it's idle) ?

from audio-visualizer-android.

gauravk95 avatar gauravk95 commented on August 17, 2024

The Visualizer class requires the Microphone permissions, as it takes data from the stream playing. This class is provided by the android.media package, and the permission is compulsory for it to work.

You are right when you say data is already available in the audio file. We can also extract the data from the file, do some FFT, normalization and make it work without the permission. But, for that I will have to write a complete custom implementation of extracting the audio data and managing. I went with the Visualizer class to reduce the complexity and the work load, but the library can surely be improved. I just don't have time to do that right now.

Regarding sample, I will get on it ASAP.

from audio-visualizer-android.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

It's just that a visualizer on audio files can be used on music players, but it's weird to request a microphone permission for this...
I tried to make noise while it played, to see if it affected it, as I thought that's why it requested the permission...

So I think that currently, the only usage for this library would usually be of recording apps, though it could be used on such apps in all recording steps (before, during, and while playing).

from audio-visualizer-android.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

I've also noticed that if I change the volume level to 0, I don't see the visualizer do anything anymore.
Is this intentional? Could it be changed?

from audio-visualizer-android.

gauravk95 avatar gauravk95 commented on August 17, 2024

Nope, it can't be changed, but would be possible using custom implementation. I will see if I can pull some time to implement the custom version of the library.

from audio-visualizer-android.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

By "custom implementation" , you mean something that will look at the audio data directly, without the need for microphone ?

from audio-visualizer-android.

gauravk95 avatar gauravk95 commented on August 17, 2024

Yeah correct.

from audio-visualizer-android.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

Cool. Thank you for your time. I hope you succeed.

from audio-visualizer-android.

christina-bakirtzi avatar christina-bakirtzi commented on August 17, 2024

Supposing we have a recorder that goes like this:

    try {
        recorder.prepare();
        recorder.start();
    } catch (IOException e) {}

where should we put the setRawAudioBytes(byte[]) to have it display in real-time?

from audio-visualizer-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.