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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:05:32+00:00 2026-06-12T08:05:32+00:00

i am trying to make an audio file (*.mp3 , .wav etc) from a

  • 0

i am trying to make an audio file (*.mp3 , .wav etc) from a video file (.avi,*.mp4 etc) using xuggler here is my code

Code:
IMediaReader reader = ToolFactory.makeReader("D:/Frames/my.mp4");
IMediaWriter writer = ToolFactory.makeWriter("D:/a.mp3",reader);
int sampleRate = 44100;
int channels = 1;
writer.addAudioStream(0, 0, ICodec.ID.CODEC_ID_MP3, channels, sampleRate);
while (reader.readPacket() == null);

but its not create an audio file for me. please guide me where i am doing wrong. if you will correct it or provide some other code for this purpose which is different from mine then i’ll be thankful.

  • 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-12T08:05:33+00:00Added an answer on June 12, 2026 at 8:05 am

    after searching a lot on internet about this problem i have found that i can do this same work with JAVE (Java Audio Video Encoder) so i try that and it works for me ..so i thought i post the solution there that if some one else face the same problem then he/she can see my work.

    its actually use ffmpeg behind the scene and it will extract audio from video file and much more for encoding stuff.
    here is the link for JAVE
    http://www.sauronsoftware.it/projects/jave/index.php

    also see one example there and i am posting it here also for your convenience

    File source = new File("source.mp4");
    File target = new File("target.mp3");
    AudioAttributes audio = new AudioAttributes();
    audio.setCodec("libmp3lame");
    audio.setBitRate(new Integer(128000));
    audio.setChannels(new Integer(2));
    audio.setSamplingRate(new Integer(44100));
    EncodingAttributes attrs = new EncodingAttributes();
    attrs.setFormat("mp3");
    attrs.setAudioAttributes(audio);
    Encoder encoder = new Encoder();
    encoder.encode(source, target, attrs); 
    

    hopefully it will help u..!

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

Sidebar

Related Questions

I'm trying to stream an audio file from a server protected by session-based authentication,
I am trying to figure out how to take an audio file from the
I am trying to receive a file (audio, .CAF) from a socket in C
I am trying to play a wav file from my PG application and it
I am trying to make Quicktime files stream from a HTML document using the
Trying to make the infamous checkall checkbox for dynamically created rows from a MySQL
Trying to make a cross protocol, same domain request from https to http. I
I'm trying to make a cross-device/browser image and audio preloading scheme for a GameAPI
While trying to make a Audio Player , currently working at Playlist ,and i
Alright I have two problems. I'm using AVAudioPlayer to play a simple audio file

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.