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

  • Home
  • SEARCH
  • 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 8250591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:56:41+00:00 2026-06-07T23:56:41+00:00

i have a problem in my media player AudioManager. When i decrease volume of

  • 0

i have a problem in my media player AudioManager. When i decrease volume of sound through seekbar i will decrease but when i do progress increase it is not increase sound volume in same state.. please help me to sort out my problem..
thanks in Advance…

audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);

int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
int curVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);

volume2 = (SeekBar)findViewById(R.id.volbar2);
volume1 = (SeekBar)findViewById(R.id.volbar);

volume1.setMax(maxVolume);
volume2.setMax(maxVolume);
volume1.setProgress(curVolume);
volume2.setProgress(curVolume);

volume1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

  @Override
  public void onStopTrackingTouch(SeekBar seekBar) {

  }
  @Override
  public void onStartTrackingTouch(SeekBar arg0) {

  }
  @Override
  public void onProgressChanged(SeekBar seekBar, int progress, boolean arg2) {       
    if(seekBar.equals(volume1)){
      mediaPlayer.setVolume((progress/100.0f),(progress/100.0f));
    }
  }
});

volume2.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

  public void onStopTrackingTouch(SeekBar seekBar) {
    // TODO Auto-generated method stub
  }

  public void onStartTrackingTouch(SeekBar seekBar) {
    // TODO Auto-generated method stub
  }

  public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
    // TODO Auto-generated method stub
    if(seekBar.equals(volume2)){ 
      mediaPlayer2.setVolume((progress/100.0f),(progress/100.0f));
    }
  }
});
  • 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-06-07T23:56:42+00:00Added an answer on June 7, 2026 at 11:56 pm

    this code works
    Enjoy

         audioManager = (AudioManager) this.getSystemService(this.AUDIO_SERVICE);
        seekBar = (SeekBar) findViewById(R.id.seekBar1);
        seekBar.setMax(audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC));
    
    
    
        seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
    
            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub
    
            }
    
            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub
    
            }
    
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                    boolean fromUser) {
                // TODO Auto-generated method stub
    
                audioManager.setStreamVolume(audioManager.STREAM_MUSIC, progress, 0);
    
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with playing video in mediaplayer. I have a sound but
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have a problem, I have written a simple Media Player for Windows Phone
i have a little problem with the media player class. I have a button,
i will show you an image below but before that... if you have seen
I have an HTML document ( here ), which creates an iframe-based media player
PROBLEM HISTORY: Now I use Windows Media Player SDK 9 to play AVI files
I have seen alot of posts about it stopping sound early. This is not
I'm having a seeker bar for media player and I have implemented as below.
I am using a media player. I have the option for starting ,stopping and

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.