Streaming .wav file over network

Hi ,
I am trying to stream a .wav file over the network using datagram sockets and packets. When it gets to the other end it is just noise but you cannot make out what the music is.
Any ideas would be most appreciated!
code below
byte[] data;
int bytesAvailable;
          String     strFilename = "test.wav";
          File     soundFile = new File(strFilename);
          AudioInputStream     audioInputStream = null;
          try
               audioInputStream = AudioSystem.getAudioInputStream(soundFile);
          catch (Exception e)
               e.printStackTrace();
               System.exit(1);
while (thread != null) {
          int     nBytesRead = 0;
          byte[]     abData = new byte[EXTERNAL_BUFFER_SIZE];
          while (nBytesRead != -1)
               try
                    nBytesRead = audioInputStream.read(abData, 0, abData.length);
               catch (IOException e)
                    e.printStackTrace();
               if (nBytesRead >= 0)
try {
connection.send(new DatagramPacket(abData,1000));
}catch(Exception exec) {
System.out.println("Record: Exception sending packet:\n"+exec.getMessage());
try {
thread.sleep(50);
}catch(InterruptedException exec) {}
}

Streaming? looks like your dumping the whole file into a datagram packet. How are you receiving it on the other end?

Similar Messages

  • Streaming audio file over the network w JMF. How to know when the file end

    Hi
    I am streaming audio file over the network using JMF. I want to be able to know when a file end so I can close the streaming session.
    Can some one please help
    Thanks

    If you put a ControllerListener on the Processor that's associated with generating the RTP stream, it'll generate an "EndOfMedia" event when the end of the file is reached.

  • Transferring file over network? what can I use besides ssh?

    What can I use to transfer file over network besides using ssh?
    This is only for experimental purposes. I have used ssh before, by using command like this:
    (time cat /run/shm/test/input/totalInput.tar | ssh username@ip-server "cat > /dev/null") 2>>/run/shm/test/p3_UC_ctime_tar.txt
    or this, if I tried to compress a file and then transfer:
    (time bzip2 -kfc1 /run/shm/test/input/totalInput.tar | ssh username@ip-server "cat > /dev/null") 2>>/run/shm/test/p3_ctime_tar.txt
    However, I think ssh is killing my transfer speed. I am getting only 10-20Mbps.. Router should support over 200-300Mbps.
    What can I use besides ssh? I was thinking about netcat, but what I don't like is that I have to open port on the other side for each new file transfer.

    Well, what I am conserned with things like scp and ssh (I tried scp too) is encryption.
    I just moved one file over to a server with scp, and I got about 2.1MB/s... which is about 16.8 Mbps..
    I am using Linksys E900, which is wireless-N router. Connection exist between two computers only, nothing else is using that router. However, there is another wireless point outside of our room, which is used for public University network. I don't know how much of effect it would have on our set up.
    Both computers have plenty of disk space. One computer (actually development board) uses sd-card for its OS and other disk space.
    About 200-300Mbps.. is just something I saw on router's specs.
    Last edited by kdar (2012-08-19 03:22:28)

  • Streaming wav files once edited won't work in flash

    I need some help with streaming wav files in flash. I can load a wav file and stream it ok using actionscript 3 into my fla file. However if I go to edit the wav and make it shorter the saved wav file will not play. I have used a trial version of soundbooth to see if I could somehow change the settings for the wav but I still cannot make it work. It will stream as an mp3 but I want the file to loop and need the file to be wav. I have attached the file. I have no problem when I upload the file into the fla file but that is not what I want to do.
    Can anyone help me.
    Cheers.

    Thanks for the input however I had already tried a variety of combinations. But I did go through it again.
    The Flash Player supports 8-bit or 16-bit audio at sample rates of               5.512, 11.025, 22.05, or 44.1 kHz. I have tried all permutations of wav from 8 bit to 16bit and the all sampling rates from 11.025. The original file is attached at it was at 32000hz. Nothing I can do will make these play in flash once edited. I am using soundbooth howeve I have used audacity and wavepad. I have removed the metadata tags as that was suggested in one of the forums. I have attached the original files and the shortened file that I cannot get to work. I went into Soundbooth and went through all the preferences and checked the box where it asked for FLash compaticble at 16bit 44 hz etc. This is really frustrating. I know wav can be streamed.

  • Send wav files over a network

    Hi folks,
    I need to send sound files over a network. The files I'm wanting to send are wav files. I kinda have the mechanism that sends a file, but I am not sure how to convert wav files into something that I can easily send. Do I need to convert them into bytes, serialize them...etc I don't know.
    Can anyone please point me in the right direction? An example would be very much appreciated.
    Thank you,
    E

    hi
    this is very simple
    convert voice to bytearray
    just create one server socket and client socket then connect a sockets and transmit
    download sample from
    http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html

  • Copy files over Network - sometimes message "insufficent access priv"

    Hi have a MacBook Pro & a MacPro.
    I copied big files wirelessly all the time.
    I software updated to QuickTime 7.1.6 and now I have two issues.
    1) When I try to pull files over the network, I often get the message "insufficent priveleges". The file is in the middle of copying, so it starts the process just fine. I am logged in as a registered user. I can copy the files from the Mac Pro to the laptop.
    2) I used to be able to stream video over my wireless without a hitch (even on my old Powerbook g4). Now streaming video plays for a few a few minutes and locks up.
    It seems the update did something bad. However QT video plays fine locally from my laptop harddrive.
    Anybody with similar problems or know any solutions?

    Thanks for the tip. I tried repairing permissions and lots of things were fixed on the laptop but the problems remain.

  • Accessing shared files over network

    I am having some problems with a couple of database files that I access with a Java program over network. Different computers running this program all need access to these files, and my question is if anyone know of a good way to make sure that only one user have access to these files at the time. There is no server software running were the files are stored, they are simply reached through file sharing. Currently I am creating a lock file indicating that someone is editing the files, however if I am unlucky 2 users create that lockfile at the same time and then both get access to the file corrupting it. Anyone experienced this and know of a nice solution to avoid it?

    I am having some problems with a couple of database
    files that I access with a Java program over network.
    Different computers running this program all need
    access to these files, and my question is if anyone
    know of a good way to make sure that only one user
    have access to these files at the time.Use a database server instead.

  • Crashing in PS CS and Quark when opening files over network

    Mac Pro and MacBook Pro 10.4.8 using Adobe Photoshop CS2 and Quark 6.52 will crash or become VERY unstable when opening files from server or remote machine. Server is 10.3.9 or remote Mac running 10.4.7, all works fine IF file are copied to client machine, but cannot use -File/Open dialog. This is a network isue in relation to Intel translation, is there a fix (Rosetta?)

    Try looking for some "special" characters in file or folder names ( e.g. / or ?).
    I had similar problems with PPC-Apps (InDesign CS2 and 4D Client 2003) since 10.4.7 and 10.4.8. App crashes or shows strange grey boxes on the screen when I tried to open files over the network, no probs with same files locally.
    MacBook Pro   Mac OS X (10.4.8)  

  • Sharing Files Over Network and computers not showing up in sidebar

    I am trying to figure out how to share files over the network. Now when I click onto the computer in my shared items, I do not get access to the home folder that I used to see. Instead, I am getting a folder image with the user name below it, but it says Sharepoint. However, when I click on the folder I get another folder that says dropbox with a down arrow. However, when I click on that it says it cannot be opened because I do not have privileges.
    What happened to being able to being able to get access to the home folder from the users on the computer that you are trying to retrieve files from.
    Are there settings I need to adjust to allow me to get access to the files on the other computer.
    The other computer is an iMac G5.
    My next issue is that my wife's iBook G4 doesn't even show up in the shared items in the sidebar.
    Again, are there settings on this computer that have to be adjusted.
    Thanks in advance.
    Russell
    Message was edited by: Russell Massey

    Hi Henry, and a warm welcome to the forums!
    While you may get help or a solution here, It's quite acceptable to start a new topic of your own, certainly feel free to start a new topic to attract more helpers to your particular situation, here's a link if as is often the case, it's hard to find out where to do it...
    http://discussions.apple.com/post!default.jspa?forumID=752
    It asks me to loggin I dont remember ever setting a login and password for it.
    You need to add a User to the PC, or try with the PC's username & PC's Password.
    My Main Problem is that my PC can see my Macbook...
    On the Mac, did you enable Windows Sharing in System Preferences>Sharing>Services ?
    I want to be able to use my printer that is hooked up to my Windows 7 PC with my Macbook
    That has to be set first on the PC.

  • Crashing When Saving Photoshop  File Over Network

    Photoshop & InDesign CS3 crashes whenever I try to save a file over the network to a another shared Mac Pro computer. Another Mac Pro on the network can save to the shared computer without a problem.
    SPECIFICS
    - Three Macs and a 3 PC's on Ethernet network
    -Problem started after upgrading to Leopard
    - I have tried reinstalling the entire Creative Suite without Version Cue
    - Tried deleting the com.adobe.mediabrowser.p.ist and Photoshop.plist preferences.
    - If I create a new file on my computer and then immediately save it, it usually does not crash on the first save. But after I do a few things to the file and then try to save again, it hangs up giving me the spinning pinwheel with the message in the Force Quit dialog window that Photoshop is not responding.
    +- I am unable to force quiet Photoshop; I have to do a hard reboot.+
    Adobe tech support believes it is a network problem, any ideas what might be causing the problem?
    Are there any know issues with Leopard and CS 3 with certain network configurations?

    I have experienced issues with saving photoshop files over a network since upgrading to 10.5.3
    This is a major issue, and one that apple seems quite about.
    See related response on Adobe.com
    http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403815&sliceId=2

  • Stream wav file in Flex

    I am trying to use the 'Sound' object to play wav file. It
    seems that it only works with mp3 not wav. I am using Flex 2.0 beta
    2. The documentation is not very clear on what formats can be used
    with Sound class.

    The Flash Player will only play mp3 file. You will need to
    convert your wav
    into an mp3. Google mp3 converter to find a utility to do
    this.
    The documentation for flash.media.Sound mentions in several
    places that an
    mp3 is required.
    From the docs:
    The Sound class lets you work with sound in an application.
    The Sound class
    lets you create a new Sound object, load and play an external
    MP3 file into
    that object, close the sound stream, and access data about
    the sound, such
    as information about the number of bytes in the stream and
    ID3 metadata.
    Can you tell us where you looked in the documentation?
    Perhaps we are not
    mentioning the mp3 requirement in a more obvious place. If
    so, we can update
    the documentation.
    Thanks,
    Jason Szeto
    "liaod" <[email protected]> wrote in message
    news:e20q73$jqv$[email protected]..
    >I am trying to use the 'Sound' object to play wav file.
    It seems that it
    >only
    > works with mp3 not wav. I am using Flex 2.0 beta 2. The
    documentation is
    > not
    > very clear on what formats can be used with Sound class.
    >

  • How to send simple file over network!

    Hi!!
    can any body guide me how to send a simple txt and other files (not media files) over net!
    what would i have to do to do so ?
    do i have to understand the files headers and got to use udp protocols if yes then plz tell me how
    Thank you!

    Well thanks for informing me...
    But what if i want to send a media file using udp not rtp protocol then should i have to so the same ?
    any one going to help me in other way ?
    Thank you !

  • Streaming Files over networks

    Hi,
    I am new to java. Have been trying to work on a system that transfers files from one machine to another (remote) machine.
    I am basically using a FileInputStream combined with BufferedOutputStream in my server, where I am (right now) transferring byte after byte to the BOF and then flush it to the network.
    On the other end I am using a FileOutputStream with BufferedInputStream. Am using a BufferedOutputStream to wrap the FileOutputStream. I read the BIS byte by byte and transfer it to the BOS. When I flush it, it is supposed to write to the File via the FOS.
    I have tried various combinations and possibilities, like .. different read write methods ... and readers and writers.
    PROBLEM
    The basic problem is that when my client reaches the end of the file it is supposedly reading (from the network), it halts. It stops ... doesnt go anywhere. The snippet is as follows .. the while check gets stuck when it is supposed to get out.
    while((ch=fileStream.read()) > -1)
    bos.write(ch);
    System.out.println("File Recieved, Enter new command");
    bos.flush();
    I would be really grateful if someone gives me a pointer.
    [this particular problem, amongst others, is consistent for all combos I have tried]

    When the file is done on the server side (writer), does it close the connection? If not, it's never going to get the -1 on the client side (reader) to break the loop.
    If you can't close the connection, then you have to come up with some sort of protocol to allow your endpoints to talk in a more meaningful way. At the very least, start the transfer with the file size and only read that much on the client. Or some other start/end of stream markers that the client side can look for. Or just get an FTP server/client code (maybe TFTP) for Java and use that.

  • Unable to access shared files over network after period of time.

    First off, I don't think that this issue is related to our router, but I have been searching for a fix and can not find one. We have a WRT54GS. Now, on to our issue:
    At my work, we have a small network with computers sharing files between the others. I have attached a network diagram to help explain this better.
    Our Win7 machine is our main computer that shares an external hard drive with much information that the other computers need to access. What we have noticed is either after a sleep, or even a period of time of say, 2 hours, those files are no longer able to be accessed. The Win7 machine is still sharing them, but the WinXP machines are unable to access them anymore and my Mac can see the computer is unable to connect to the folders. I have gone and attempted to get some help over at Microsofts site but that was a fail. Here is the link to the forum post there. http://social.answers.microsoft.com/Forums/en-US/w7network/thread/f0a2e8d6-f75a-41d7-a280-c6f3adbffa...
    A member there gave me this:
    The Network connection is probably not resuming after sleep. 
    First try this, http://www.ezlan.net/Win7/power_save_win7.jpg
    It is in the Network Connection Properties under the Network card configuration.
    If it already checked this way, or does not work after checking, the Network card has to be taken out of the computer's Power Saving loop, and stay on all the time.
    Otherwise, Updating the Card with the latest OEM drivers (downloaded from the computer's support site) might help too.
    On a rare occasions, some cards might be "Quirky" in this regards and need to be replaced.
    --I would like to add that this DOESN'T ONLY happen after sleep, it also happens after a time of being used.
    I attempted those and no luck. This problem is still occurring and the only way we can fix it is by restarting the Win7 machine. But even if it is being used, we have no idea when those files are unable to be accessed.
    *I will add that the Win7 machine is still able to access the other computers when this problem occurs if that helps.
    **The Win7 machine is a Dell T3500 running Windows 7 64bit. I can provide specific hardware if needed. The drivers are all up to date as of yesterday.
    ***So upon looking in the Windows XP machine, both of the folders from the Win7 machine disappear once this problem occurs in the My Network Places folder. And one folder is on the internal drive, one is on external. The computers are in this situation now where I am unable to access them. The Win7 machine can read and write from the other computers, but the other computers can even see the Win7 Machine.
    ****All the connections are wired and are not using the wireless.
    Thanks for any help that anyone may have for me!
    Steve
    Network Map > http://scubasblog.com/network.jpg
    Dell Support Forum with same issue I posted >> http://en.community.dell.com/support-forums/network-internet-wireless/f/3324/p/19337620/19716797.asp...

    It sounds like there is incompatibility issue with XP and Win7. To isolate this, do you have another Win7 machine? Try to add it to the network and check if the shared drives are accessible after sleep. If you don't have another computer, try virtual machine and create a Win7 system.
    Update your LAN card driver from the manufacturer's site. Don't use the driver from windows update.
    Lastly, does this happen to your XP machines? Like, one of the XP machine sharing a folder and falls asleep. When it wakes up, does Win7 machine can still access the shared folder?

  • Final Cut doesn't playback when copy any files over network

    First, i want say a thanks for all guys who help us here. Thank you very much. Much appreciate.
    Now, problem...
    My Final Cut works perfect sice a starded used 2005, never i have a one problem.
    But last week i discover this:
    When a copy any files between macs over a network the final cut doesn`t play in the sequence. nothing happening. but if i stop copy in the finder, it ok, everything back normal again.
    I try using a project over a network and its perfect, fine.
    only if i copy anything in the finder and final cut doesnt play.
    Guys, anyone have this problem? Its normal?
    I dont know, i try many this before i post here and nothing works.
    Ps.: I have two imac i7 and this two have same problem.

    I hope i understand you right.
    when you copy a file from one network to another sometimes the file paths are lost. Like if you have a drive called FCP HDD on one cpu and FCP HDD3 on another. The original path is associated to the copied files on FCP HDD drive and not the FCP HDD3 drive so a path would be lost there.
    If you are connected via gigabyte ethernet cable and the imacs are synced then there would only be a latency problem as the gigabyte ethernet is slower than sata and FW 400 or 800.
    If you are just coping the source media (meaning the files you captured from the cam) then all of your paths will be new based on the place you copied them too.
    so if i have a project like 'My Commercial' and that is the name of the project file then it is it own project. The media within that project is associated to which ever drive you put it on.
    If i move the project to another computer then the media is not there.
    Why? Because the project is looking for the name of the original drive which may not exist on the imac you moved the project too. Unless you have a server.
    Also, Even if you do move the media files to the drive that IS connected to the new computer the drive is most likely to have a different path for the media.
    What you want is to connect the 2 cpus in a way that allows drive sharing.
    Do you get the red 'Media Offline" error in the timeline?

Maybe you are looking for

  • Trying to create a Invoice based on Order need help Error -5002

    the dreaded -5002 error is haunting me too! and I could not find a matching solution for this in the forum.... I need help quickly on this. I am trying to create invoices for some orders so the Base - Target relationship is retained. The orders I pic

  • IPod Shuffle with iTunes on Win8 64 bit. Doesn't work for me.

    Running Win 8 64bit. iTunes initially recognizes my iPod shuffle but then it disappears. Properties say driver is up-to-date. Details say Windows is removing the device. Restarted with connected and same problem. Downloaded iTunes today - 1/5/13. Any

  • When can we see the new updates coming to the cc

    when can we access The New updates that were announced before NAB 2015 ? like the Morph Cut and the Colour correction updates from Lumetrie?

  • Checking FM in "HOLD" in PO

    Hi Gurus, When I´ve tried put in u201Choldu201D a purchase order just refering the one purchase requisition the system has showed the message error "FMEF022u201D. Ps. There is in my purchase requisition one funds reservation. There is some configurat

  • Where is the EXPANSION SLOT UTILITY in 10.7?

    My understanding is that it is located in syteme/library/core services but its not there for me. Was it renamed, moved or removed for 10.7? Thanks