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 8338447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:35:38+00:00 2026-06-09T04:35:38+00:00

I am using xugglu in java in order to switch the bitrate of the

  • 0

I am using xugglu in java in order to switch the bitrate of the input MP3 file, storing it in a output file. I took one example I found on the net the loads the file to a reader and adds a writer as a listener. Does anyone know how can I then modify the bitrate?

Here’s the code I’ve been using:

import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaViewer;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;
import org.slf4j.LoggerFactory;


public class TranscodingExample {

private static final String inputFilename = "/home/user/Desktop/file_changed.mp3";
private static final String outputFilename = "/home/user/Desktop/file_changed.flv";

public static void main(String[] args) {

    // create a media reader
    IMediaReader mediaReader =
           ToolFactory.makeReader(inputFilename);

    // create a media writer
    IMediaWriter mediaWriter =
           ToolFactory.makeWriter(outputFilename, mediaReader);

    // add a writer to the reader, to create the output file
    mediaReader.addListener(mediaWriter);

    // create a media viewer with stats enabled
    IMediaViewer mediaViewer = ToolFactory.makeViewer(true);

    // add a viewer to the reader, to see the decoded media
    mediaReader.addListener(mediaViewer);

    // read and decode packets from the source file and
    // and dispatch decoded audio and video to the writer
    while (mediaReader.readPacket() == null) ;

}
}

EDIT-1:

I couldn’t really get around this one, so I just used a linux command doing that inside the Java app. You can find a reference to the code here. The command I used was:

ffmpeg -i in.mp3 -b 112k out.mp3

It converts the mp3 to a new one of bitrate equal to 112k.

  • 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-09T04:35:40+00:00Added an answer on June 9, 2026 at 4:35 am

    Take a look at IAudioResampler:

    Used to resample IAudioSamples to different sample rates or number of channels.

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

Sidebar

Related Questions

Using Java,I have to fetch multiple sets of values from an XML file to
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
I am pretty new to image capturing using java. Which is better and easy
Using jQuery, one can easily find out whether a particular element is visible using
Using the HTML5 File API I can get the Binary String representation of a
Using mercurial, I've run into an odd problem where a line from one committer
Using Github's Issue Tracker, how can one create an issue tied to an organization
Using Java, how can I extract all the links from a given web page?
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
In my project I am using a JAR file provided via Maven. But what

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.