Problem in character stream...sound is distorted

hi friends,
I have made a file copy program on audio file(mp3).
its likely succeeded but the destination file give the distorted sound. I have used the character stream to make it done.
however, it was not a problem using byte streams before few days.
below is program
import java.io.*;
public class CopyBytes {
    public static void main(String[] args) throws IOException {
        BufferedReader in = null;
        BufferedWriter out = null;
        char []buff=new char[20000];
        int ch=0,length=30;
        try {
            in = new BufferedReader(new FileReader("1.mp3"));
            out = new BufferedWriter(new FileWriter("2.mp3"));      
          for(;ch!=-1;)
            while ((ch=in.read(buff,0,20000))!=-1) {
                  //System.out.format("%s\n\n break\n",new String(buff));
                  out.write(buff,0,20000);
                   break;               
        } finally {
            if (in != null) {
                in.close();
            if (out != null) {
                out.close();
}although there was not use of two loops, actually i was making file splitter program and got this situation accordingly
any analysis on distorted sound?

san_4u wrote:
I have used the character stream to make it done.Why? Clearly, you are not working with text files, so you shouldn't use FileReader/FileWriter at all, but work with streams and bytes. AFAIK, FileReader/FileWriter may perform special operation on the input/output due to character encodings, which you definitely don't want to happen with non-text files (as e.g. MP3 encoded audio files).

Similar Messages

  • Problem streaming sound only to Apple TV

    Apple TV with the latest software of of Nov 23
    Macbook Pro with Retina Display running 10.10.1
    - I can see my itunes lib through home sharing and is able to play movies, see photos without any issue.
    - I can mirror my desktop using airplay and play movies and music without any issues.
    The issue comes when I try to stream sound only on to Apple TV. I have the ATV connected to my audio player and stream Spotify. The sound is choppy and broken. Going against my instinct I purchased a new router (Asus RT-AC68U) which obviously was not the issue since airplay was working on when I mirror my desktop.
    After a couple of hours with apple support, I saw on the forum that some people has issues with bluetooth. I TRIED TURNING OFF BLUETOOTH AND IT FIXED THE SOUND STREAMING TO ATV. I have an apple blue tooth mouse.
    I tried both shortcuts, from preferences - sound - output and Apple TV and using Option + Sound Icon to select Apple TV instead of internal speakers. Both have the same problem.
    I hope its a software issue rather than a hardware one and it can be updated soon.

    A Follow up on this issue , bluetooth also stops AirPlay from working reliably.

  • I have problem with playing stream  fullscreen. it goes black but with sound

    i have problem with playing stream fullscreen. it goes black but with sound. i have to wait 10-15 minutes then i can press fullscreen. what to do?
    s

    Thanks!! but i been fixing now for 10 minute ago by restart my macbook pro. My case is it show normal with Intenal-speakers and nothing mark with red light or mult so i tried to restart that it working again

  • I've updated my ipad to iso7 now the sound is distorted through the speaker and headphones, it is unusable! Is anyone else having this problem?

    I've updated my ipad to iso7 now the sound is distorted through the speaker and headphones, it is unusable! I wouldn't dare to update my iphone. Is anyone else having this problem? Can't seem to find any fixes online?

    A reset should fix it:
    Double click the Home button. Slide up with one finger on ALL your apps to close them.
    Then, Press the Sleep/Wake button + Home button and hold 15 seconds or until you see the Apple logo.
    This will reset your device without erasing data, apps or settings.

  • How to convert character streams to byte streams?

    Hi,
    I know InputStreamReader can convert byte streams to character streams? But how to convert the character streams back to byte streams? Is there a Java class for that?
    Thanks in advance.

    When do you have to do this? There's probably another way. If you just start out using only InputStreams you shouldn't have that problem.

  • Flash animation with stream sound not playing in mac

    Dear all,
    I have made a 5 min animation with stream sound. Its playing perfectly in PC. But in mac, its not playing. Stream sound starts from frame 60. So mac plays the swf plays till 60 frame, after that it pauses. I tried importing different sound format (wav, aif, mp3) and tried with all sound export setting but the problem remain same; its playing only till 60. When i removed the sound, it played till end. Even with event sound, it plays till end. But with stream sound, the problem. The problem is only in mac; in pc its perfect.
    I am using VMware Mac OS x leopard in window xp for testing purpose. I tested it in laptop with mac; but the problem is same. What could be the solution?
    Thanks in advance. Waiting for solution.
    Bhushan Pradhan
    spherenepal.com

    Dear all, I solved the problem myself. The problem was with the sound driver of mac. After installing sound driver, the problem is gone. Bhushan

  • StopAllSounds vs. new Streaming Sound not playing

    In my timeline, I'm using a stopAllSounds action (because the
    user could be coming from anywhere in the movie and I need to stop
    whatever narration might be playing), then, in the next frame, I'm
    trying to stream a new sound. My problem is that the streaming
    sound doesn't play. I've tried adding a few frames between the
    stopAll Sounds action and the start of the streaming sound, but
    that doesn't seem to be the problem. Any ideas would be greatly
    appreciated.
    - BillG

    I was about to try your suggestion, but after sending a few more test emails, I discovered that it does in fact play the sound sometimes.  I sent about 20 test emails, and they were all received using the "idle" command, with about 75% of them playing the sound.  There was a 5-10 second delay between the messages being received and the sound playing that I don't remember from Snow Leopard, but I'm not positive about that.
    It shouldn't be the actual sound that is the issue, being that it is played sometimes, but I still don't know why it's not playing every time.  I tried receiving messages with the app running in the background, with it minimized, and with it as the active window, but I couldn't find any specific instance that caused it to not play the sound.
    I wasn't having this issue in Mail 4.  It didn't start until I installed Lion, which I did a clean install of, if it matters.
    I'm still open to thoughts on this, and thank you for your help.

  • IMovie HD sound gets distorted

    I have a few teachers who have made iMovies using iMovieHD. When you play the movie in full screen mode after about 5 minutes the sound gets distorted. I thought that this was just an isolated incident and that the movie was corrupt, but now I have two teachers, two computers same issue.
    These are being done on MacBooks 10.5.6 with 1G RAM and they have not been converted to quicktime yet. Since iMovie HD is easier for my staff they use it rather than new '08 7.1.4.
    Is that the issue?

    Hi
    a. What kind of audio used ? .aiff, .mp3, from iTunes etc.
    b. Any external hard disk used ? Formatted as ? USB or FireWire ?
    else General troubleshooting list.
    *Not knowing the origin to Your problem - General approach when in trouble is as follows:*
    • Free space on internal (start-up) hard disk if it is less than 10Gb should rather have 25Gb
    • Hard disk is untidy: Repair Permissions, Repair Hard disk (Apple Disc Util tool)
    • Garageband-fix. Start it and Close it. Re-try
    • Delete iMovie pref file - or rather start a new user/account - log into this and re-try
    iMovie pref file resides:
    Mac Hard Disk (start-up HD)/Users/"Your account"/Library/Preferences and is named: com.apple.iMovie.plist
    While iMovie is NOT RUNNING - move this file out to desk-top.
    Now restart iMovie.
    • Third party plug-ins that doesn't work OK (not relevant for iMovie’08 or 09)
    • Program miss-match: iMovie 5.0.2, up to Mac OS X.4.11 AND QuickTime 7.4.1 - is OK
    • Program miss-match: iMovie 6.0.3 or 6.0.4, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    • Program miss-match: iMovie’08 v. 7.0.1, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    • Screen must be set to Million-colors
    From LKN 1935: (in this case = iMovie HD (5), I tried it all, but nothing worked.
    Your answer (above) has been helpfull insofar as all the different trials led to the conclusion that
    there was something wrong with my iMovie software. I therefore threw everything away and reinstalled
    iMovie from the HD. After that the exportation of DV videos (there has not been any problem with HDV videos)
    to my Sony camcorders worked properly as it did before.
    Yours Bengt W

  • Sound very distorted at bootup with Creative Sound Blaster X-Fi Xtreme Audio

    I have a new HP Pavilion Elite e9180t PC with a Creative Sound Blaster X-Fi Xtreme Audio sound card, an OEM card offered by HP.  On two occasions, only two, so far, when the system is done booting the sound is distorted and it buzzes and hisses periodically.  Upon reboot it is fine.
    I have no idea what is going on and am concerned that this is a system of a pending failure.  Is there something I can check?
    Thanks.

    I have this exact same system with the exact same problems.  I called HP and got a woman who insisted it was all in my head.  She didn't say that, but she continuted to tell me that unless she personally heard the problem herself, she could not help me.  I told her it didn't happen all the time but usually at bootup and about every 6 hours or so as I was playing games throughout the day.  I am a computer professional also, which should be noted, and I have worked tier 3 support for many years so I know how much knowledge a tier 1 support person has, which is what she was.  I couldn't understand much of what she said due to the accent, which made it even more frustrating.  Additionally, she remotely got on my system and clicked a bunch of things that made absolutely no sense whatsoever to the resolution of the problem.  It seemed to me that she was trying to portray herself as "fixing" the problem so that I would agree it was now fixed and move one without her having to send me a new sound card, as I suggested.  She asked me the same questions over and over "so what exactly are you hearing?" and "How often does this occur?".  After the 4th time my frustration really began to show.  Especially after "I'm afraid I have to conclude that there is not a problem with your soundcard if I cannot hear it." and "the diagnostics say the sound card is fine so it must be your speakers" even though I have swapped out the speakers several times and it also occurs on the headphones.  Additionally, I bought TWO identical systems, one for me and one for my husband and his does not have the same problem.  She tried to tell me that our parts were not identical, even though I opened both computers and I will tell you they certainly ARE identical.  She is now calling me in exactly 6 hours because I told her that the issue occurs every 6 hours or so -- clearly she does not understand that that was an estimate of how often it occurs, not an exact timeline.  I am really frustrated.  She also told me there were no other complaints for this issue and now I find this forum.  I also found a similar forum on the creative website.  hmmmm.  That tells me she was lying.  She refused to let me speak to anyone else, also.  Where are the award winning service and support technicians in all of this??  I mean, I work with HP from a business perspective all the time and I get better service.  I am extremely frustrated.

  • Internal Speaker sound like DISTORTED

    Hi All,
    My MBP 15" 2008 started to giving me problem. This time - Internal Speaker sound like DISTORTED! No matter what genre of music, what software i play from even iTune, it just distorted. Though, the volume cut down to 50%, still can heard that distorted sound. I don't know what's the issue suppose to name as ~ distorted? Crackle? ...
    I've try to reset PRAM & SMC ,with no luck. Software updated and restart too, No Luck.
    Can you help me? Thanks!!

    Not a usual complaint.  Is it just one speaker or both?  If the former, it would probably be a hardware issue and may have to be replaced.  If the latter, considering what you have tried already, I would suggest a OS reinstall (this is just a guess on my part).  Consider an appointment at an Apple store genius bar.  It is free and they may have a definitive answer for you.
    Ciao.

  • Problem with kde and sound

    Hi!
    I've a problem with KDE and sound.
    When KDE shows a alert the alert's sound sounds with delay. 3-5 seconds.
    Same happens with kde start.
    Can anybody help me?
    Thanks!

    Pilli wrote:
    Hi!
    I've a problem with KDE and sound.
    When KDE shows a alert the alert's sound sounds with delay. 3-5 seconds.
    Same happens with kde start.
    Can anybody help me?
    Thanks!
    Change the player to mplayer or something in the control panel (Sound and Multimedia - System notifications - Player Settings).

  • I can hear both a clean sound and distortion at the same time.

    I can hear both a clean sound and distortion through my monitors and headphones. I am playing into a Presonus USB and directly into a MacBook Pro. Any idea how I can get rid of the clean sound?

    You probably have a mix knob on your interface that switches between dry and wet signal. The knob should mix the signals.

  • My imported swf files have lost their streaming sound. What can I do?

    I am trying to import a swf I made that contains streaming sound. When I place it on the time line and press cntr enter my animation plays but with no audio. I see the symbols from the swf and the swf inside my library. When I open the swf file inside my project it is broken down frame by frame with no audio. I can add audio back into my movie clip so I know that movie clips can support streaming audio. But I would rather not have to do this.
    I'm very new to flash so I am hoping there is something big that I am missing.
    In addition to my previous question: I need to embed a lot of objects over and over in this project I am working on. Each object will have controls for play back of itself. Is there some reason I cannot do this?
    Thank you for any advice you may have.

    Thank you for your reply
    Ok. I will need to maintain a libary of movie clips that contain streaming audio and simple scripts. Does anyone know of a good tutorial for importing a file at runtime? I've seen something called shared libary properties and it has a field for a url. I put a swf file on my web site and took it's url and put it into this field but nothing shows in my library. What else do I need to do?

  • My iPad mini sound is distorted on everything.  Sound, typing, music! Any suggestions

    iPad mini sound is distorted on everything. Sound, typing, music!  Any suggestions?

    Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing, Wall Paper, Sound etc will be reset

  • I connected my iPod Touch to a stereo system phono input using a cable with stereo jacks (red and white) on one end and that plugs into the iPod's headphone jack.  The problem is that the sound is extremely muffled and bass-heavy, with little treble.

    I connected my iPod Touch to a stereo system phono input using a cable with stereo jacks (red and white) on one end and that plugs into the iPod's headphone jack.  The problem is that the sound is extremely muffled and bass-heavy, with little treble.  I have to turn the bass control on the stereo receiver to pratically zero in order for the sound coming through the stereo to be acceptable.  Is there a setting on either the iPod or the stereo that I need to change in order to fix this?

    The phono input is for a phonograph.  The iPod does headphne output is not that same as a phongraph output.  Does th stero have an AUX input?  That should be compatible.

Maybe you are looking for

  • Scroll bars & creating buttons problem

    I am trying to create a basic photo browser. The upper area is the enlarged view of the image. The lower portion is a scrollable view of the thumbnails in the directory chosen. I have most of it working...except that the scrollable view doesn't scrol

  • Samsung stratosphere keeps getting stuck in landscape mode?

    All of a sudden a couple of days ago my phone started getting stuck in landscape mode, even when the auto rotation was off. I didn't mess with any of the settings to make this happen but sometimes I have to turn the screen on and off a couple of time

  • Automated export/import of objects

    We have an installation of Tarantella Enterprise Edition 3.42. We would now like to "upgrade" to Enterprise Edition 4.0. For specific reasons we do not want to do a normal upgrade. Instead we would like to setup a new server, prepare the new environm

  • Test granularity - best practice

    We're struggling with a couple issues.  We want to write our LabVIEW in a generic fashion such that they simply perform a task, and unless it's a very simple task, they don't make the determination of pass/fail - we want to leave that upto TestStand.

  • Apple ID not accepted in apps or itunes

    I have changed my password several times and Apple ID not accepted in iTunes or updates.