Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6556449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:56:47+00:00 2026-05-25T12:56:47+00:00

I am writing an app that basically just tests if we can get anything

  • 0

I am writing an app that basically just tests if we can get anything at all from the microphone.

It works perfectly on several android devices, but not on the LG Optimus. Everytime I call MediaRecorder.getMaxAmplitude on the LG it returns 0.

The device is successfully recording, because I can listen to the recordings.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:56:47+00:00Added an answer on May 25, 2026 at 12:56 pm

    getMaxAmplitude returns the maximum amplitude since the last time you called it.

    So, the first time you call it, it initializes itself (and so returns 0) the second time, it should return another value. According to the documentation :

    getMaxAmplitude() returns the maximum absolute amplitude that was sampled since the last call to this method. Call this only after the setAudioSource().

    Returns the maximum absolute amplitude measured since the last call, or 0 when called for the first time

    Or, if you use it right, you have the same problem as I have. My code works on a galaxyTab 7(Froyo), but not 10.1 (Honeycomb).

    EDIT : I repaired my problem (I hope it’ll help you too). Make sure the first time you call getMaxAmplitude, in order to initialize it, you called start() first.
    I used:

    recorder.prepare();
    recorder.getMaxAmplitude();
    recorder.start();
    //listening to the user
    int amplitude = recorder.getMaxAmplitude();
    

    When it should have been :

    recorder.prepare();
    recorder.start();
    recorder.getMaxAmplitude();
    //listening to the user
    int amplitude = recorder.getMaxAmplitude();
    

    EDIT : This code still has flaws it seems. This code doesn’t seems to work on S2, for instance. It’ll return 0. But I call getMaxAmplitude() only twice, so if you need to update the amplitude every second for example, it may be ok.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an App that basically uses 5 business entities, A, B C, D
I'm writing an app that will basically be like Fraps, but it will push
I'm writing an app that supposed to copy a bunch of files from one
I'm writing an app that allows you to script the buttons from a wiimote
The app I'm writing needs to get information from a remote database and then
For an app that I am writing I need to display several views (in
Basically I'm writing a metronome app, but I'm using a sound file that, depending
I'm writing a silverlight app which does some real-time charting. Basically, I just have
I'm writing an Android app that is basically a ListView populated with an array
I'm writing an application that is basically just a preferences dialog, much like the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.