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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:23:22+00:00 2026-05-13T09:23:22+00:00

I’m analyzing music mp3 files. What I’m doing is extracting the audio data from

  • 0

I’m analyzing music mp3 files. What I’m doing is extracting the audio data from the file and computing music similarity.

I’ve been using javazoom in order to handle mp3 files. By using audioFormat I’m extracting the raw data from the mp3 file:

byte[] audioBytes = new byte[numBytes];
in_format_init = AudioSystem.getAudioInputStream(musicFile);
AudioFormat formatInit = in_format_init.getFormat(); 
AudioFormat formatFinal = new AudioFormat(
            AudioFormat.Encoding.PCM_SIGNED,
            formatInit.getSampleRate(),
            16,
            formatInit.getChannels(),
            formatInit.getChannels()*2,
            formatInit.getSampleRate(),
            false);
AudioInputStream streamIn = AudioSystem.getAudioInputStream(formatFinal,     in_format_init);
while (((numBytesRead = streamIn.read(audioBytes)) != -1))
{...}

By doing this I store the audio data (without headers or tags) in audioBytes and then the info stored in the array is processed.

My question is: is it posible to extract the audio information from an mp3 audio file and store it as I do it in my example? I’ve been reading about JMF, but it’s confusing for me.

Thanks.

  • 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-13T09:23:23+00:00Added an answer on May 13, 2026 at 9:23 am

    I’ve just had a quick look at the JMF API so I’m not a 100% sure this will be correct or even work at all, but try something like this:

    try {
      File f = new File ("/path/to/my/audio.mp3");
      DataSource ds = Manager.createDataSource(f.toURI().toURL());
      ds.connect();
      ds.start();
      ...
    } catch (java.io.IOException e) {
      ...
    } catch (NoDataSourceException e) {
      ...
    }
    

    After this try getting the controls from the DataSource: ds.getControls(), and see if any of the controls allows you to read the raw audio data.

    You’ll probably have to do all kinds of cleanup as well, e.g. ds.disconnect(), after you’re done reading the audio.

    Also, don’t forget to install the JMF MP3 plugin

    — Lauri

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

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of 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.