Correct way to stream audio

Pardon my ignorance. I have tried to search the forums, but the search box on this site hasn't got the possibility to limit the search to only this forum.
My question is simple: If I capture audio from the microphone on my computer using a TargetDataLine and want to stream it over the internet to some other computer with some other software somewhere, what is the correct way to do so?
Alternative 1: I create a ByteArrayOutputStream and a ServerSocket
Alternative 2: I missed something in the documentation and should actually have constructed some other Line object connecting to an outgoing port on the computer.
Thanks for any help

rebol wrote:
Pardon my ignorance. I have tried to search the forums, but the search box on this site hasn't got the possibility to limit the search to only this forum.You're fine...Ignorance is what forum questions are all about ;-) No point asking a question you already know the answer to...
My question is simple: If I capture audio from the microphone on my computer using a TargetDataLine and want to stream it over the internet to some other computer with some other software somewhere, what is the correct way to do so?JavaSound doesn't have any way to do this. You do have a bunch of options about how to go about doing it, though...
Alternative 1: I create a ByteArrayOutputStream and a ServerSocketThat would certainly work, but there are a handful of problems with it.
(1) ServerSocket = TCP, and TCP = resends dropped packets. If you resend dropped packets, your stream will progressively get further and further behind "real-time" because every resent packet will add some delay that will never be made up.
(2) This is probably going to take up a fair bit of bandwidth if you're capturing decent quality audio.
So you'd definately want to use UDP instead to avoid the delay thing. Problem there is...
(1) UDP packets aren't guarenteed to be delivered in order, so you'll want to drop the out of order packets.
Actually, there's a method out there that's widely used to send media across a network that's implemented in UDP that's called RTP (Real-time Protocol). RTP is implemented in an add-on package for Java called JMF (Java Media Framework).
With JMF, you can capture audio, transcode it into a different transmission-friendly RTP format, send it over the network, receive it on the other end, and play it using the built-in JMF player object. And if you're just wanting to do RTP and Sound, you can do it all just by including an extra JAR file.

Similar Messages

  • Does anyone know a way to stream audio from Snow Leopard to a PPC running Panther?

    I have recently aquired a iMac PPC, I've freshly installed Panther on it and it runs a treat. I was wondering however if there is a way to stream audio from my main Desktop, a 2007 iMac running Snow Leopard. iTunes library share isn't a solution either as I use Spotify a my main source of music and unfortunetly it is no longer supported for PPC's.
    Thanks, Tim

    Unfortunately I could get neither of these to work, probably because of my own ineptitude.
    I couldn't get VLC to output from Spotify, this could be my own fault.
    I also couldn't make Airplay play with OS X 10.3.9.
    I did however find a messy workaround.
    I am currently using Airfoil on my main Desktop to output Spotify and then am receiving it on Airfoil Speaker on my iPhone, which is in turn connected to my 10.3.9 iMacs audio input via a 3.5mm Jack.
    You need to download an app called LineIn for 10.3 (http://www.rogueamoeba.com/legacy/) to play the sound from the input from the built in speakers.
    To be fair it's not that messy it just requires you to have a device that can have Airfoil Speakers installed on it and have a 3.5mm Jack.

  • Are there ways to stream audio or does everything have to be under 10 MB?

    As a DJ with lots of long audio mixes (anywhere from 50 to 80 minutes), I'd like to post on my site using iWeb, anything over three minutes needs to be condensed down via iMovie (according to the iWeb program) .... but even if I choose "email" in the export step of iMovie, I can't get my long audio files anywhere close to 10 MB!
    Am I gonna be stuck with crappy audio quality? Are there other ways to get audio on there or other other ways to compress large files? Or can I just keep the files huge with great quality and hope people can listen to them?
    Also, will people be able to control click on them to save them to their desktops? Or can they just "listen" to them on my site?
    Oh - OR ......... when they're podcasts, are they transferred from somewhere else as long as I submit them to iTunes?? Would that keep the quality good as well as minimizing any bandwidth it takes to download them? Am I answering my own question here????

    i've seen comments about this. try searching "streaming" in this forum.

  • The Best way to stream audio in Flash CS4

    Hi all.
    I have lots of mp3 audio files on my site (40 or more).
    I am using an audio player and that's working fine but, it takes a while for some of the mp3's to kick in. I have reduced their bit rates from 160 to 128 and In Flash CS4/Publish Settings/Flash I have changed the MP3 to a bit rate of 8kbps. is this OK?
    Anything else I can do to speed things up?
    Regards
    M

    the flash settings won't help download and stream those mp3's faster.  lowering the mp3 bitrates will help.
    and other than ensuring nothing else is loading when you start to stream an mp3, there's nothing you can do to get it to download more quickly.

  • Ways to stream audio from programs other than iTunes?

    Ok, the only way I have heard of doing this is with Rogue Amoeba's Airfoil program, which costs $25. Is there any other way to work around this for free? I think it's not worth me going out and buying a $100 product and then having to pay $25 for a feature that should be integrated. Anyways, ideas? Thanks for your time.

    Sorry but Airfoil is the way to do it.

  • Streaming audio from Logic 7.2

    Has anyone found a good way to stream audio from Logic to another computer via the web? I'm tweaking a sound design mix for a client in another city and would love to be able to get them on the phone and have them be able to participate in real time. Where's the Rocket Network when you need it? : )Thanks.

    2 solutions:
    1. Old school: get a telephone coupler and send the mix down the phone line.
    2. iChat: feed your mix into a small mixer, open a mic when you want to talk, and feed the mix into your "line input" on iChat (make sure it's selected in preferences) and do an audio chat.
    DP800 G4/1 Ghz Ti PB 15"   Mac OS X (10.4.5)  

  • Stream Audio

    Hi-
    I recently purchased a MacBook Pro 2.2Ghz. Now, I am a music freak and always have iTunes running or some kind of media playing. I am always finding myself string a cable to my AV receiver from my laptop which is getting annoying fast. Is there a way of streaming audio from my MBP to my av receiver? I know about the Airport express but based on what I have read, it only works with itunes audio and I would like to be able to stream any audio whether it be from youtube or DVD player or whatever.
    Thanks

    True, the Airport Express works with iTunes unless you're using Airfoil: [http://www.rogueamoeba.com/airfoil>
    Airfoil allows you to stream from any application, however, the software isn't free. This is the only route I know since I own an Airport Express myself.
    Hope that helps.

  • Is there a way to stream my macbook pro audio through itunes to basestation

    Hey I love to stream my itunes through the basestation but, is there a way to stream my macbook pros audio so I can hear things playing from my safari or final cut or whatever other program to the speakers in airport??? Thanks

    Rogue Amoeba's Airfoil should do just what you want. I use if for streaming things like Slacker and Pandora through my Airport Express. It's not free but it's well worth the price. You can try it out for a few minutes (then the sound degrades) to see if it works for you.

  • Any way to disable the bluetooth handset and use enable streaming audio only?

    I don't use bluetooth in my car to make or receive phone calls and only use it to stream Pandora.  On my previous BBs I was able to disable the handset function and just use streaming audio, but I'm not finding any similar options on the Z10.  Does anyone know of a way to do this? Right now I'm just powering off my stereo when I receive a call, but that is not a great solution.  Thanks for any feedback.
    Solved!
    Go to Solution.

    Hello rangerdanger and welcome to the BlackBerry Support Community Forums.
    Thanks for your question regarding Bluetooth.
    The BlackBerry Z10 does not have the option to edit what services are allowed with a Bluetooth connection.
    Depending on your vehicle, you may have to access your Bluetooth set up or settings within your car's dash to control what features are enabled with Bluetooth. 
    If you are unsure how to access these settings, contact your dealership or consult your owners manual.
    Cheers!
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Is there a way to auto shut-off when I listen to streaming audio?

    I like to listen to streaming audio podcasts. At night, I would like them to automatically turn off after a period of time, for example: 1 hour; 1/2 hr; 15 min; etc. Is there a way to do that?

    If you are using the Podcast app tap the little clock icon at the top while the podcast is playing.

  • Streaming audio to video UI component, any ways possible?

    I'm looking into streaming audio from online radio sources our locally to the video component in interface builder, but I'm sure where to start. Any suggestions?

    for a more generic approach -- since mpd requires you to put the media on the server and only plays certain defined filed types -- pulseaudio might be interesting, or even dlna/upnp? that last one for sure would be the most cross-platform solution. then each client could decide for itself which kind of audio to pass to the hub, be it mpd, radio, youtube etc.
    interesing experiment you're doing here btw, i think more people will be interested in using a single small device that routes all their network audio to a stereo.
    p.s., in case you want to stick to the classic mpd setup, there are windows clients available incluing a handy firefox plugin:
    http://mpd.wikia.com/wiki/Windows_Compatibility
    http://mpd.wikia.com/wiki/Clients

  • VLC doesn't save streaming audio to mp3 anymore

    I want to save streaming audio from the internet to my HDD in mp3 format while listening to it at the same time.  That worked fine when I did it with VLC, using the GUI.  To be specific, here are the settings that I used:
    VLC main menu: File>Open Network Stream>Open...Network>tick HTTP/HTTPS/FTP/MMS and enter the URL (http://vruk.sc.llnwd.net:12265) >under Advanced Options tick Stream/Save and click on Settings (opens Stream Output window)>Outputs, tick Play locally, tick File, click on Browse and enter filename and location for the stream saving file, i.e. /home/robert/vlcout.mp3>Encapsulation method, tick on Raw>Transcoding options, tick on Audio codec and select mp3>Bitrate 128 kb/s, Channels 2>OK, OK, to start recording. Stop or Quit VLC, to stop recording.
    Two days ago I upgraded VLC from v.0.8.5-9 to v.0.8.6a-4 (which also upgraded ffmpeg from v.20060920-1 to v.20070131-1), and now the above procedure isn't working anymore.  The stream isn't playing anymore over my speakers while the encoding supposedly is going on, the vlcout.mp3 file is empty (0B), and VCL gives me the following error messages:
    stream_out_transcode error: cannot find encoder ((null))
    stream_out_transcode error: cannot create audio chain
    main error: cannot create packetizer output (mpga)
    It looks as though VLC is failing to encode the stream to mp3.  The VLC documentation (see http://www.videolan.org/streaming-features.html) in a table of "possible output formats for the transcoding module" says that for mp3 audio "you have to compile ffmpeg with libmp3lame support."  Has the new ffmpeg v.20070131-1 (in extra) been compiled without mp3 support?  If so, why?  Apparently, the older version I was using last week supported mp3.
    libmp3lame is installed on my system.  There is a very recent alternative ffmpeg-svn-8218-1 pkgbuild in AUR that enables libmp3lame in the configure section of the build but when I try to install the package built that way it conflicts with ffmpeg v.20070131-1, and to remove the official ffmpeg v.20070131-1 I'd first have to remove a slew of other packages that depend on it.
    Is it possible to remove VLC v.0.8.6a-4 and ffmpeg v.20070131-1 and go back to the older versions that worked for me?  There was talk of a bug in ffmpeg in this forum at the end of January; what about it?
    What should I do?
    Robert
    Last edited by RobF (2007-03-14 16:25:51)

    I solved the problem for now by downgrading both vlc and ffmpeg to the earlier versions that I was using before.  Saving an audio stream in mp3 format is working again now.
    I believe there are problems with the current versions of both vlc and ffmpeg.
    1. vlc 0.8.6a doesn't seem to have ffmpeg enabled, i.e.
    $ vlc --list | grep ffmpeg
    VLC media player 0.8.6a Janus
    whereas with the older version I get
    $ vlc --list | grep ffmpeg
    VLC media player 0.8.5 Janus
      ffmpeg                FFmpeg audio/video decoder/encoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)
      ffmpeg                FFmpeg chroma conversion
      ffmpeg                FFmpeg audio/video encoder
      ffmpeg                FFmpeg demuxer
      ffmpeg                FFmpeg video filter
      ffmpeg                FFmpeg crop padd filter
      ffmpeg                FFmpeg deinterlace video filter
    2. The current package ffmpeg v.20070131-1 in extra may not refer to various libraries correctly in its configure parameters.  E.g. in AUR there is an alternative pkgbuild ffmpeg-svn 8218-1 from 04-Mar-2007 in which the original configure parameters were replaced as follows:
    --enable-mp3lame --> --enable-libmp3lame
    --enable-vorbis --> --enable-libvorbis
    --enable-faac --> --enable-libfaac
    --enable-faad --> --enable-libfaad
    --enable-a52 --> --enable-liba52
    --enable-dts --> --enable-libdts
    Has the ffmpeg package in extra been compiled with mp3 support which is needed for the transcoding module of vlc to encode in mp3 format?  The alternative ffmpeg package in AUR conflicts with the ffmpeg package from extra, and I don't know how to tell the new vlc to use the alternative package instead of the one from extra. 
    Someone ought to look into this.
    Robert

  • Playing input stream audio in j2me

    want to make a text-to-speech synthesizer for mobile phones.
    for that i am using FreeTTS (text-to-speech synthesizer written in java)
    so i have made a client-server model where i have a midp client which is sending text to the FreeTTS acting as a server.... for this i am using socket...
    so basically -- client is sending text to server -- server processes the text and sends the audio stream back to client
    the problem is i dont know how to play the audio stream received on client side
    i tried to copy it in a buffer but its not working..
    do i need to save the file in some format before playing it?
    or can the player play the audio stream directly?
    this is how i am copying the contents in the buffer
    try
    InputStream is = socketConnection.openInputStream();
    byte[] buff = new byte[1024];
    int bytesIn = is.read(buff, 0, 1024);
    ByteArrayInputStream bis = new ByteArrayInputStream(buff);
    player = Manager.createPlayer(bis, "audio/x-wav" );
    player.start();
    but it gives an error saying
    javax.microedition.media.MediaException: Malformed wave media
    i tried to display the contents of bis on console it reads
    java.io.ByteArrayInputStream@d590dbc
    i tried the same with the Free TTS client and got the same output.
    so i think client socket is even receiving the audio stream properly...however, im not sure.
    is the whole client-server using socket idea correct?
    if yes, please tell me how to play this audio stream in j2me (the client)
    if it is wrong then please tell me a correct way to do this.
    can the input stream be stored as a WAV file and then played? if yes, then how can i store it as a WAV file? Can this be achieved by appending a WAV header?

    I once tried the similar thing, I ended up buffer all the content locally (from bluetooth), then play the wave file.
    Maybe someone else has better idea.

  • What is a common way to create audio chat rooms?

    What is an expected way to create audio chatrooms? Either try to mix all published audio streams into single one and republish it under common name? Or just inform all clients about each other and allow each one to connect to a stream, published by each other?
    Do I need to write custom webapplication with my own scripts in it, or this is some default functionality?
    Thanks.

    I want all visitors to hear each other. User ability to mute himself is required, but user ability to mute other sides separately is not required. I.e. user is just hearing all sound in the room.
    Also recording of room "ambience", which is consisting of voices of all visitors is required.
    So, I wonder if mixing is possible at all? Does API have appropriate functions? Won't it load a server hard?
    And if mixing is impossible or not recommended, then how is it possible to record entire room sounding? Is it practical to put individual visitor sessions separately? But how to place them in time correctly?
    Thank you in advance!
    Regards,
       Dmitry

  • Correct way of importing an iMovie 6 movie into Final Cut Express?

    Hi,
    Many thanks in advance for your attention.
    Any correct way to import an iMovie 6 HD movie into Final Cut Express for further editing?
    I tried.
    1. I Exported the iMovie, at Full Quality and it made a Quicktime version of that movie.
    2. I then Imported this Quicktime version into Final Cut Express.
    3. The audio was smooth, but at regular intervals, the video freezes for a second (and then moves on).
    4. The movie plays smoothly back in its original iMovie incarnation and in its Quicktime incarnation. Only in Final Cut Express is there this intermittent freezing. Stop and start.
    5. I have Final Cut Express 3.5.1 and iMovie 6 HD.
    Thank you,
    - Ross

    "Full Quality" QuickTime export from iMovie gives you a DV stream which will need rendering in FCE. Rather than "Full Quality," choose "Expert Settings," and then the following:
    Video
    DV-DVCPRO - NTSC (assuming you're in USA)
    Sound
    48kHz
    16-bit

Maybe you are looking for