Converting .wav files to mp3 format.

Hi,
        I am trying to convert a wav file into mp3 format using the below code. I am not seeing any errors in the console but at the same time the mp3 file is created without any content. Any ideas on how to address this issue ?
  Format[] FORMATS = new Format[] { new AudioFormat(
  AudioFormat.LINEAR) };
  String srcFilePath = "C:" + File.separator + "Users"
  + File.separator + "vkiran" + File.separator + "Desktop"
  + File.separator + "test" + File.separator + "4a714ea2.wav";
  String mp3FilePath = "C:" + File.separator + "Users"
  + File.separator + "vkiran" + File.separator + "Desktop"
  + File.separator + "test" + File.separator + "4a714ea2.mp3";
  File srcFile = new File(srcFilePath);
  File destFile = new File(mp3FilePath);
  MediaLocator source = new MediaLocator(srcFile.toURL());
  DataSource d = Manager.createDataSource(source);
  ContentDescriptor cd = new ContentDescriptor(
  FileTypeDescriptor.MPEG_AUDIO);
  Processor p = Manager.createRealizedProcessor(new ProcessorModel(d,
  FORMATS, cd));
  p.configure();
  System.out.println((p.getDuration()).getSeconds());
  MediaLocator destination = new MediaLocator(destFile.toURL());
  DataSource ds = p.getDataOutput();
  DataSink sink = Manager.createDataSink(p.getDataOutput(),
  destination);
  sink.open();
  sink.start();
  sink.stop();
  sink.close();
  p.stop();
  p.close();

You are converting the WAV files to mp3 format before transferring them to the iPod?
You're using iTunes to do this?
Just for the record, the iPod will not play mp3 files below a bit rate of 32kbps nor will it play compressed WAV files.

Similar Messages

  • Urgent How to convert wav files into mp3?

    Can anyone plz tell me how can i convert wav file into mp3 using JMF? tell me any sample programme, any method in JMF........ help me plz

    Examples could be found on the JMF Solutions page.
    Only I can say about mp3 through network - it's hardly possible. I recommend GSM for compression2transmit. It could be used via GSM content descriptor. I'm not sure, but I suppose MP3 is supported only for files, there's no MP3.RTP or such (if you want to transmit files, it should not cause any problems).
    About JavaSound - it does not matter... You still need JMF to be installed on Client, and AppletCapture to be enabled. Futrher - would it be DirectSound, JavaSound, or anything else - just the deal of JMF.
    I tried to use JavaSound capture with proceeding AudioInputStream to JMF, but failed to do this.
    About your problem - best solution seems like that:
    capture sound
    put it into processor
    set format to GSM
    transmit
    so then, server receives it and formats it as it likes.
    If you want to transmit exactly files, you should use just some of pure java after capturing. java.net, or such thing.

  • Convert REM Files to MP3 Format?

    I have downloaded several songs via the Amazon MP3 application on my Blackberry Curve 9300.  Little did I know that the songs were downloaded as rem files and not mp3 format?  I cannot upload the files to my desktop or laptop computers nor my Kindle. 
    Amazon said since I downloaded most of the songs over 3 months ago, they cannot move them over to my Cloud Player.  How do I convert rem file to mp3 format?  I do not want to have to purchase these songs again.

    That process above won't work. Waste of time.
    Your files were downloaded as MP3 files, but you have content encryption placed on your Media Card, and then the REM extension is added to the filename, because you have protected those files.
    You must turn off the encryption first, and then you can copy the files and they will be usable.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I need to find a way to convert .WMA files to .MP3 format on Lion

    I need to find a way to convert .WMA files to .MP3 format; with Snow Leopard, I could do that using iTunes, but since upgrading to Lion, I can convert the files to a .mov format in Quick Time, but cannot move the file into iTunes in order to convert it to .MP3. If you can suggest a work-around or an app that will work with Lion, would be much appreciated.

    Haven't used it myself, but worth a look http://www.macupdate.com/app/mac/27103/all2mp3
    Stefan

  • Converting WAV files to mp3 upon import

    I have changed my import settings in itunes preferences to encode incoming wav files to mp3, restarted my computer, but when I import the wav file, it stays a wav file, no matter how I set my preferences. Why can't I make mp3's, or that is how the F**K can I get my computer to do what I'm asking it???
    P.S. I still love my mac, but jesus, come on!!!

    I have changed my import settings in itunes preferences to encode incoming wav files to mp3, restarted my computer, but when I import the wav file, it stays a wav file, no matter how I set my preferences.
    Import will only convert to the selected format when your RIP from CD or select a file already in iTunes then menu Advanced -> Create {import settings} version.
    Make sure your Import settings are MP3.
    Hold Option, go to iTunes menu Advanced -> Convert selection to MP3, then select the WAV files you want to add to yoru library
    This will convert them to MP3 and add them at the same time.

  • How do I batch convert wav files to mp3?

    Just wondering how I can convert a batch of wav files into mp3 files (including metadata).
    I was looking thru features in both soundbooth and bridge, but I can't find it (if it exists).
    Thanls

    Found this FREE easy to use mp3 converter called All2Lame, here:
    http://members.home.nl/w.speek/all2lame.htm
    You will also need to download LAME MP3 encoder, and copy the lame.exe & the lame_enc.dll files into the all2lame directory to get it to work:
    http://www.rarewares.org/mp3-lame-bundle.php
    The program offers a lot of command line type options, so you need to read the documentation to understand all your choices, but here's a 'quickstart' line you can put into the 'switches' line that will make highest quality stereo mp3's using variable bit rate technique:
    --vbr-new -V 0 -q 0 --resample 44.1
    If you prefer mono to save space, use this line:
    --vbr-new -V 0 -q 0 -m m --resample 44.1

  • Converting WAV files to MP3

    When trying to convert my wav files to mp3 in itunes, I get an error pop-up that says "The disk could not be read from or written to." These files worked fine before I updated to the new itunes.

    PaulSimpson wrote:
    The files are on my hard drive Steve. They were audio files that I downloaded from my personal camera. I didn't even think these kinds of files had permissions.
    OK just wanted to make sure. Sometimes, read/write errors occur when write protection is enabled on, say, an SD card. (that little tab on the top)
    All files actually have permissions under Mac OS X, one of the aspects of the underlying UNIX file system. Every file is capable of being readable, writable, and/or executable by either the owner, the group to which he/she belongs to, and/or everybody. Sometimes accessing files becomes erratic when the file's permissions unknowingly change, thus the good idea to "repair permissions" from time to time with Disk Utility.
    However, you mentioned that the original WAV files came from your digital camera. What happens if you try to open these WAVs with the QuickTime Player? Do they play as per usual?
    PaulSimpson wrote:
    If you still think repairing my permissions with my install disc is the way to go, I'm game, but I'm going to need a bit more step by step.
    We'll save that for a little later. Originally, I was leaning toward the feeling that the hard disk may have needed verifying/repairing (through Disk Utility) - because of the read/write errors. But it is possible that it may be an issue with the WAV files themselves.

  • Converting WAV files to MP3 files

    I have a USB turntable for converting my vinyl records to digital. When the files are imported to itunes they are large WAV files. I there a way to set up itunes to automatically convert the WAV files to MP3 files?

    Old thread, but still very useful. I too looked for a converter for Mac
    for ages and stumbled across your forum. Now you can use an app called audio converter for mac,  It costs a bit, but u can try it out free first to see if it works for what ,you need it for. Plz click the link below to get more info: http://www.mp3converter-mac.com/wav-to-mp3-converter-for-mac/

  • Distortion after converting wav file to mp3

    Hello,
    I am working with a .wav file of 8k sample rate, 16-bit, mono of a Skype conference call that was recorded through the computer. The wav is file is Microsoft ACM: Microsoft ADPCM. The audio quality of the original is not great, as you can imagine, but when I make my edits and convert to mp3 it sounds horrible. I don't know the technical term for it, but it sounds muffled and distorted--the effect you get when you cup your hand in front of your mouth and move it around while talking. I'm at a loss for what to do. Is there some setting I need to change before converting? I know it's a low sample rate (I usually work with 44.1K), would that contribute to the problem?
    Any help is greatly appreciated!
    Thank you.

    In a quick test, I was able to get significantly better results with an 8K, 16-bit source converting to MP3 when changing the MP3 setting to 16Khz.  In the File > Save As dialog, after selecting MP3, click the "Change" button next to "Sample Type" and change the sample rate there.  The file size was practically unchanged, but the audio quality was increased and looking at both files in spectral view showed a definite improvement.
    Edit:  Oops, I responded via e-mail and didn't realize this was posted to the Audition 3 forum.  I suspect the results will still be better with the MP3 encoder in Au3 - both are by Fraunhofer.  Here were the differences I saw when writing to 8K vs. 16K.  The resulting file was 29KB in both cases.
    MP3 saved at 8K Sample Rate setting
    MP3 saved at 16K Sample Rate setting.

  • Trying to convert wav file to mp3 using itunes?

    Is there not an easier way to convert a wav file to an mp3.  I import my file or folder but it does not convert.  I have had to manually ask it to create an aac or aca out of each import.  shouldn't it convert audimatically when I import file or folder.  It did on the last version before this new update.  Please help.
    Flustered

    If Garageband doesn't work, try Audacity.

  • Converting .wav files to .mp3 files in Adobe Audition 3

    I am trying to save a .wav file as an mp3. file.  When I go to Save As and click on file type/Mp3, it asks me if I want to overwrite the current .wav file.  When I say yes, it saves it as a .wav file.  How do get it to save as a .mp3 file?  I'm certain that there is an easy way to do this, but I'm missing it.  Any help from this knowledgeable forum would be most appreciated.
    thanks
    dk

    Next time you want to save as an MP3, type the full name of the file you want to save with the full extension in the file name box - so that would be {yourfile}.mp3. This will reset the default save to the correct extension.

  • In iTunes 10 how do I convert WAV files to Mp3?, In iTunes 10 how do I convert WAV files to Mp3?

    In previous versions there was a simple tag for this in the Advanced window. In the current version there is no such option. Can someone advise?

    Do you mean iTunes 10 or 11?
    I'm pretty sure this is controlled by the import settings for CDs.  Go to "preferences->general",
    and click "Import settings" next to the CD line.  You can select MP3 or AAC there.

  • Trouble converting downloaded m4a files to mp3 format

    This has never happened to me before. I downloaded a full album and 3 of the 13 songs get an error saying "the file format is not valid" when I try to convert the files to mp3 format. How do I go about fixing this?

    +if I do that, it will create the MP3 files all in the same iTunes Music folder as the AAC files,+
    Yes, if the AACs are by artist/album
    +and worse, it will probably duplicate each song in the playlist.+
    No, the conversion process does not touch any playlists.
    +The only thing I can think of is to either (A) have a blowaway copy of iTunes on the Windows PC, copy all the AAC files to it, import them, and convert them, or (B) allow my real iTunes to duplicate them all, make the MP3 CDs, sort by create date or file type, and delete the MP3 duplicates from the library.+
    B sounds easier than A. You can also consider doing the conversions with a non-iTunes program such as Switch, which allows you to specify the destination folder for the new file.

  • Convert itunes files to mp3

    Help please, how do i convert itunes files to mp3 format. i purchased a hp notebook and it has itunes and windows xp home. i have always used windows media player and am new to itunes. do i have to go back to media player or can itunes do the conversion?

    The only conversion I've done is wma to mp3. To do this just simply import them they way you would any other song file. It will tell you that there are song files your trying to import that iTunes isn't compatable with and ask if you want to convert them to mp3 format. Just click yes and iTunes will make an mp3 of the respective songs. The wma's will still be there so if you want to get rid of them you'll have to delete them manually. The only downside is the conversion makes the file larger so it'll take up more space on your hard drive, but you'll be able to listen to it on your iPod.
    As for iTunes purchased music StarDeb is right. Go out and buy the album then rip it onto your hard drive. At least then if your drive crashes you'll always have a backup.

  • Converting m4a files to mp3

    How do i convert m4a files to mp3 format? Call me old fashion but i still like to burn a mp3 disc. thanks

    Are you using iMovie? Can you explain what/how you are getting to the point that you want to burn the video. My suggestions would depend on your workflow and I burn movies to DVD quite often.

Maybe you are looking for

  • Can i have the same application in two different oc4j containers?

    Hi, I have developed one J2EE application and still the updation is going on. So i wanted to to deploy the application in two different oc4j containers. so that one will be having the working version of my application and the users can use that appli

  • Open documents from within

    I was a moderate user of FInal Cut Studio, but I am completely new to anything concerning Final Cut X. My apology in advance if this is obvious. I am trying to open  someone's FCS X project file on their machine, with .fcpproject extension. I double

  • Mobile Plug-Ins in IDE

    Hi I am trying to install the Mobile Plug-ins in the IDE by following these instruction http://help.sap.com/saphelp_nwmobile71/helpdata/en/b6/0f5c4a07cd4bcdb58598760cb27766/content.htm but after doing everything, what is mentioned in that, I am still

  • WRT350N chokes and hangs on large & fast downloads

    I recently upgraded my internet speed service from my ISP (Brighthouse).  They installed a gateway to replace their old modem, but I have had it bridged so it should act as a modem.  Speedtest.net shows downloads on the order of 40-50 Mbps and upload

  • Query getting Hung Up and Application giving me TimeOut exception

    Hello Guys, I have an ASP.NET MVC5 application using database SQL Server 2013. I have stored procedure with multiple steps. I am facing a strange problem where in when I run a stored procedure that has multiple steps one of the query from the stored