12 Replies Latest reply: Oct 14, 2010 10:38 AM by captfoss RSS

    MP3 Library

    804929
      Hey guys,

      I search for a library which is able to write sound files to the mp3 format.
      I've got a binary file which contains sound data streamed in from a microphone on serial port.
      Now I need to convert it to a mp3 file.

      Do you know an handly library or is it just impossible?

      greets, zero_cool

      P.S.: Sorry if my english is bad or if this is the worng section, I'm still 15.
        • 1. Re: MP3 Library
          Kayaman
          801926 wrote:
          I search for a library which is able to write sound files to the mp3 format.
          Did you use google? You know it's a search engine.
          Do you know an handly library or is it just impossible?
          No, it's not impossible. But it might be difficult if you're not very experienced with Java.
          • 2. Re: MP3 Library
            804929
            well, google just showers me with solutions of reading and decoding mp3 files... and of course edditing id3 tags.

            i'm not the chuck norris of java programming, but isn't there any easy way?

            in worst case there maybe is a solution in another programming language?
            • 3. Re: MP3 Library
              798635
              We use LAME to convert from AVI to MP3 in one of our audio products. I don't know if it will solve your problem.
              • 4. Re: MP3 Library
                802205
                You might have better luck with a more specialized search engine than Google. Try the search feature on SourceForge.net.

                Also, I second the suggestion of using lame. Many programs use it, and it's available for many platforms. So there's a good chance your users already have it. No need to reinvent the wheel.
                • 5. Re: MP3 Library
                  DrClap
                  My Google keywords were "java mp3 library". And when I look at what that brings back, I see a whole lot of libraries which can read mp3 files and extract things from them and play them. That seems to be mostly what people want to do with their mp3 files. I don't see a whole lot of support for writing mp3 files (actually I didn't see any there).

                  However when I used "java write mp3" as my keywords I got back some hints that a thing for writing sound in a particular format is called an "encoder". Here's a link which might get you somewhere: http://www.coderanch.com/t/384091/java/java/write-MP-encoder-code-java.

                  And you don't have to be Chuck Norris. (Although it helps to not be Chuck E. Cheese either.) It just takes patience to go through the possibilities. What's harder is, when you don't see anything, you can't tell whether you just used the wrong keywords or whether there really isn't anything. In this case I think there just isn't much code out there for writing mp3 because almost nobody wants to do that.
                  • 6. Re: MP3 Library
                    802205
                    Part of the problem might be that mp3 encoding is covered by patents in a lot of countries. So there's not much commercial incentive to write or port an encoder to Java. Everybody just uses lame, which is presumably hosted in a country with more reasonable laws than most.
                    • 7. Re: MP3 Library
                      DrClap
                      kjkrum wrote:
                      Part of the problem might be that mp3 encoding is covered by patents in a lot of countries.
                      Yeah, there's that too. 15-year-olds tend not to be impressed by that sort of thing, but it's certainly a factor.
                      • 8. Re: MP3 Library
                        804929
                        thx guys you really helped me, but i think mp3 is not absolute necessary and for me just too much^^
                        for now, it's enough to make uneddited input datas hearable. I think I'll try a simple wav file at first...
                        in this context i found (a googling a day...) ther class AudioFileWriter. Maybe that's a solution for the time being, after all, it's just a school project.

                        Thank you for fast and professional support.
                        Maybe there're still any tips or notes for me?

                        zero_cool
                        • 9. Re: MP3 Library
                          793415
                          zero_cool wrote:
                          ..Maybe there're still any tips or notes for me?
                          See:
                          1) http://www.jsresources.org/examples/SimpleAudioRecorder.java.html
                          2) Java Sound
                          • 10. Re: MP3 Library
                            Darryl Burke
                            Moderator action: Moved from Java Programming. Thanks Andrew.

                            db
                            • 11. Re: MP3 Library
                              793415
                              Darryl Burke wrote:
                              ..Thanks Andrew.
                              Ditto. The mods are becoming ever more efficient, I did not even have to 'report' that one! Of course, am aiming at the state where I merely have to 'think real hard' about it, and the mods can pick it up telepathically, but - give it time.. ;)
                              • 12. Re: MP3 Library
                                captfoss
                                Andrew Thompson wrote:
                                Ditto. The mods are becoming ever more efficient, I did not even have to 'report' that one! Of course, am aiming at the state where I merely have to 'think real hard' about it, and the mods can pick it up telepathically, but - give it time.. ;)
                                If Google gets their way, it'll happen automatically before you even realize it needs to be done... and it'll predict your exact GPS coordinates and what pron you were thinking about at the exact moment you should have known but didn't...

                                Edited by: captfoss on Oct 14, 2010 10:38 AM

                                Apparently you can't write porn (p0rn) on these forums for whatever reason...