Trying to encrypt RTP audio stream

I'm trying to encrypt audio (after compression) on the transmitter side and decrypt it on the receiving side.
I tried making a wrapper around the PushBufferDataSource at both ends (provided by the processor and the RTPManager), which also wraps PushBufferStream. This sort-of works, I can use a java.nio.ByteBuffer to flip the bytes around in the javax.media.Buffer i'm reading from, and I can do a simple character swapping cipher. But, when it fails when I try to use AES, either because blocks aren't 16 bytes long, or once, I fixed that, the player trys reading too far ahead.
Second, I've tried the custom packetizer and depacketizer provided on the JMF solutions page. It does play, and I assume I need to put my encryption code in the process() method. But, that method never seems to be called.
I know the constructor is called, but process() never is, thus my encryption code is never run.
Can someone help with any of these problems???
(PS: Please send example code b/c its easier for me to understand)

I have just managed to solve this problem.
Thanks

Similar Messages

  • RTP audio stream suddenly stopped

    hello,
    i've developed an audio chat with JMF. i've tested with LAN and internet environment.
    it run ok with local server.
    but when we connect to a public server in the internet, sound that come from my peer always stopped suddenly after a few seconds (it could be more than 10 secs but less than 30 secs). although that i still see the RTP packets are still received by my computer with a sniffer program, even when the voice is lost. the strange thing is that its only me who lose my peers voice while my voice still can be heard by my peer.
    then we tested to run both applications not from my network, it runs ok.
    but i'm still curious what could possible caused this? i afraid that if the packet travels through the internet, the problem could rise again.
    i've read another topic similar to this problem in this forum. some suggested to increase the TTL of the RTP packet. i'll give it a try but, i guess i still see tha packet received by my computer even when the voice is lost.
    Thank you

    thesti wrote:
    i just wonder how should we handle StreamMappedEvent ?That's pretty application-specific question, isn't it?
    The StreamMappaedEvent occurs when a new RTP stream is received without a participant attached to it...so you're getting a stream, but you don't know from who... Subsiquently, the participant's identity will be received, and a "StreamMapped" event will occur.
    Some applications will refuse to play the RTP stream until the participant is identified, because they care who the streams are from... but bear in mind, if the participant is known when the stream is first received, no "StreamMapped" event will occur. It's only when you don't know at first that you'll get a "StreamMapped" event later.

  • Synchronization of Multiple Audio Streams

    Hi,
    I'm trying to synchronize several Audio streams during
    playback and recording. Several questions I have and not sure if
    actually feasible or how to best address :
    1/ When playing back 2 audio streams, how can I ensure the
    playback is full synchronized (<20ms difference) when client
    receives the 2 streams in playback ? Basically trying to simulate a
    mix-down with 2 // streaming. Ultimately wants to achieve this with
    about 5 audio streams playing back and can't accept tolerate delay.
    I suspect I need to synchronize the start of each stream so that
    they all start together, but not been very succesfull so far.
    Alternatively is there a way to mix-down 2 streams on server and
    send back a 1 mixed-down audio stream ?
    2/ More tricky I believe : If I playback 1 audio stream and
    start recording a separate audio stream, I'm getting again
    desynchronised. Later If I replay the 1 audio and the newly
    recorded one, both are not anymore aligned. I suspect (but not sure
    that the delay and desynchronization is introduced during the
    recording but not sure and reason I asked first question...
    If someone knows those answers or could provide some
    direction of work.... I would greatly appreciate.
    Thanks

    When it comes to FMS streams, there really is no way of
    accurately syncronizing streams. Since you can't keep data in
    buffer when pausing the stream, and you have to rebuffer any time
    you seek, it's impossible.
    The only way I've been able to sync flv's is using
    progressive download. With progressive, you can sync streams, but
    the accuracy is limited to the keyframe interval of the flv files.
    For example, if you have 2 keyframes per second, you can achieve
    sync with 1 second accuracy. with 4 keyframes per second, you can
    get the offset down to 500ms. If you make every frame a keyframe
    (makes for a huge file), you can get frame accurate sync.
    The theory is to build a class that monitors the time and
    buffer length properties of your two streams, pausing and/or
    seeking when needed to maintain sync.

  • How to merging two audio stream using jmf?

    I have received two rtp audio stream,i want to merging this to one but createMergingDataSource dou work well。please help 。

    You might use an alternative approach: Run exec task and use a external tool to do the encoding.
    You can for example use "The Swiss army knive of Sound" :) SoX: http://sox.sourceforge.net/
    I think from a performance point of view or to handle large files it would be even recommended in using such tools rather then encoding inside your application ... that might be different if you need to do the encoding in real-time ...
    Sebastian

  • Itunes 12 on Windows 7, how to open an audio stream

    Hello,
    I'm trying to open an audio stream on Windows 7 / Itunes 12, and I am not able to find the File->Open stream function (does it exist in Windows?), nor to copy paste a webradio to a playlist and edit its url.
    Anyone able to help?
    Thanks

    See AutoRuns for a tool that should give you full control over what runs at start up.
    I've seen hints that some Bluetooth controller software may be responsible for firing iTunes. If your keyboard has media control keys the whatever driver services that could also be responsible.
    Suffice it to say iTunes doesn't install as a start-up item so whatever is triggering it is some local configuration issue rather iTunes itself.
    If you have iOS devices that are set to sync wirelessly, and iTunes is set to launch when they are connected, it is just conceivable that simply having the iOS devices active when you reboot would be enough to launch iTunes, but I don't think that is the case.
    tt2

  • Problem Recording Audio Stream: audacity, HDA Intel ALC882, Stereo Mix

    Hi,
    I am trying to record an audio stream using Audacity, but I am having problems. From the mixer toolbar dropdown, I have various options for mic, line, cd, but there is no option for 'stereo mix.'  I have looked at alsamixer, and none of the capture channels are muted.  I would be grateful if someone could point me in the correct direction.
    Regards,
    Ian Sutherland

    You need pulseaudio to capture from the mixer. Try this:
    http://www.ubuntugeek.com/sound-solutio … users.html
                    it worked for me in my Lenovo T61 with HDA Intel sound
    Good luck

  • Satellite A100: audio stream recorder requires something called stereo mix

    Trying to use an audio stream recorder/convertor program but it requires something called "stereo mix". The toshiba A100 does not appear to have this?? Help?
    Tried downloading latest drivers from Tosh site for Realtek sound card but this has not made a difference.

    Here's how to fix the problem.
    1. You need a new driver in order to control the input signal given by any hardware (CD) or virtual source (WinAmp, streaming radio etc.). The driver you need is called Virtual Audio Cable that's able to connect and loop back any audio signal between any devices on your computer. You can check it out in a demo version before you buy it (price $30). Get more information and download it here: http://nrcde.ru/music/software/eng/vac.html
    2. After instalation read and follow the "Simple cable usage" part of the manual very carefully and you're ready to record on your virtual recorder from any source you want. Please notice you have to have the "Audio repeater" open (and started) in order to hear the output on your computer speakers. If you have set up the Virtual Cable 1 to control your audio input, it should be chosen as Wave in in the Audio Repeater and Realtek HD Audio output should be chosen as Wave out. This is set automatically if you In control panel/sounds and devices/devices chose Virtual Cable 1 as standard device for record of sounds instead of Realtek HD Audio input and Realtek HD Audio output as standard device for playing sound.
    3. Virtual Audio Cable mix any audio input including the Windows sounds. Select no sounds in Control panel/Sound and devices/sounds if you don't want to mix Windows sounds with your recording.
    4. Advanced functions: You can manipulate and optimize the sound quality in the cable and audio repeater setup.
    That's all - have fun
    Sincerely Cornelius
    PS. I have proved that my Satelite A100 can do the same as any other Windows computer with the Realtek driver instaled. It's the first time I have purchased third party software in order to get basic Windows sound functions to work.

  • Transmitting audio stream by RTP

    Hello:
    I am trying to transmit audio stream with this code, but i dont get it work well.
    The output is:
    C:\RUN\EX14>java AVTransmit2 file:/c:/run/format/au/drip.au 1.1.9.147 45200
    Track 0 is set to transmit as:
    ULAW/rtp, 8000.0 Hz, 8-bit, Mono, FrameSize=8 bits
    Created RTP session: 1.1.9.147 45200
    Start transmission for 60 seconds...
    Code to AVTransmit2.java:
    * Use the RTPManager API to create sessions for each media track of the processor.
    private String createTransmitter() {
         // Cheated. Should have checked the type.
         PushBufferDataSource pbds = (PushBufferDataSource)dataOutput;
         PushBufferStream pbss[] = pbds.getStreams();
         rtpMgrs = new RTPManager[pbss.length];
         SessionAddress localAddr, destAddr;
         InetAddress ipAddr;
         SendStream sendStream;
         int port;
         SourceDescription srcDesList[];
         for (int i = 0; i < pbss.length; i++) {
         try {
              rtpMgrs[i] = RTPManager.newInstance();     
    // The local session address will be created on the
    // same port as the the target port. This is necessary
    // if you use AVTransmit2 in conjunction with JMStudio.
    // JMStudio assumes - in a unicast session - that the
    // transmitter transmits from the same port it is receiving
    // on and sends RTCP Receiver Reports back to this port of
    // the transmitting host.
              port = portBase + 2*i;
              ipAddr = InetAddress.getByName(ipAddress);
              localAddr = new SessionAddress();
    //*          InetAddress.getLocalHost(),
    //*                                   port);
              destAddr = new SessionAddress( ipAddr,
                                  port);
              rtpMgrs.initialize( localAddr);
              rtpMgrs[i].addTarget( destAddr);
              System.err.println( "Created RTP session: " + ipAddress + " " + port);
              sendStream = rtpMgrs[i].createSendStream(dataOutput, i);          
              sendStream.start();
         } catch (Exception e) {
              return e.getMessage();
         return null;
    The code receptor is working well, because I tried it with JMStudio.
    Why it doesnt transmit ?
    I need your greatly help.
    Thanks.

    What is different from your previous question ?

  • Trying to put an mpeg audio streaming 'podcast' on my iPod

    Hi-I have a 5 part interview that is in iTunes that I want on my iPod to listen to in my car. It says it's an mpeg audio stream format. I have done all that I can think of to get it to my iPod but it just won't sync. If I Get Info on it, I selected the Media Kind as podcast, it's in my podcast list under Library; it's in my smart playlist (called News Shows) but it won't sync over to the News Shows on my iPod! In editing my smart playlist, I put in the artist name and album name (it is the info I entered in). No go. I don't know what I am doing wrong but I have wasted far too much time trying to get it sync over. There must be a way. Surely. Hopefully someone out there will have an answer for me! Thanks, Merry Christmas and Happy Holidays to all, Judy

    If it's a stream, you can't sync it to your iPod as it's not physically on your computer. You'd need to actually download it. It sounds as if what you have in your library is a link to the stream.
    Where did it come from? Can you check the site to see if they offer an .mp3 or .aac download?

  • JMF and audio streams

    Hi all,
    I am writing an application that reads an audio stream and performs some analysis on the audio samples (e.g. detection of dtmf tones). I'd like to be able to write some code that works both on streams from files and from RTP connections (in order to easily write test classes). I made a little test program that reads a wav file with javasound and does some audio analysis.
    public static void main(String[] args)
       AudioInputStream sound = AudioSystem.getAudioInputStream(new File(args[0]));
       int length = (int) sound.getFrameLength();
       for(int i=0; i<length; i++)
          byte[] sample = new byte[2];
          int res = in.read(sample, 0, sample.length);
          if(res != sample.length)
             throw new RuntimeException(
                "Couldn't read a 2 bytes sample from audio stream.");
          if(!in.getFormat().isBigEndian())
             byte tmp = sample[0];
             sample[0] = sample[1];
             sample[1] = tmp;
          DataInputStream ds = new DataInputStream(
             new ByteArrayInputStream(sample));
          goertzel(ds.readShort());
    }Now, I tried to do the same using JMF but I failed. More specific in JMF:
    1) How can I get informations about the stream I'm reading? (e.g. all infos I can get from AudioInputStream's getFormat() method)
    2) Is there a way to get a stream from a DataSource and determine at runtime if the stream is in a particular format I'm expecting, WITHOUT bothering if it is coming form RTP, audio file or something else?
    3) Eventually, Is it hard to use the stream I'm reading to create a new DataSource that some other component will use?

    Sorry but.. I don't know which is the appropriate subclass: I can't find it. I guess you missed "instanceof" in Java 101, eh?
    Moreover I'd like to find a class that is not something like "RTPStream" or "AudioFileInputStream" but something representing just the audio stream itself.There are ways you can get access to the raw data as it flows through the system, but as far as I know, there's no way of gaining random access to the audio stream itself...
    Note that a solution could be to use javasound AudioInputStream class and a simple java rtp library. I could implement my Audio analysis methods in order to work on "abstract streams" (given a particular audio format), then write a test class that work with audio files and a real application that gets input streams from RTP connections.
    I just want to know whether JMF allows me do do that or not?It'd be relatively simple to use JMF to receive an RTP stream and "export" it to JavaSound... you'd just need to write a custom DataSink.

  • Audio Streaming with NetStream on LCDS or FDS

    Hi. I can't make audio streaming working on FDS neither on
    LCDS. I want to record audio on server.
    When trying to :
    quote:
    new NetStream(this.netConnection);
    i get
    quote:
    01:19:48,140 INFO [STDOUT] [Flex]
    Thread[RTMP-Worker-2,5,jboss]: Closing due to unhandled exception
    in reader thread: java.lang.IndexOutOfBoundsException: Index: 0,
    Size: 0
    at java.util.ArrayList.RangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at
    flex.messaging.io.tcchunk.TCCommand.getArg(TCCommand.java:260)
    at
    flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java: 821)
    at
    flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:424 )
    at
    edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPo olExecutor.java:665)
    at
    edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx ecutor.java:690)
    at java.lang.Thread.run(Unknown Source)
    The same code works fine on RED5.
    What's wrong?
    RTMP channel definition is :
    quote:
    <channel-definition id="my-rtmp"
    class="mx.messaging.channels.RTMPChannel">
    <endpoint uri="rtmp://{server.name}:2040"
    class="flex.messaging.endpoints.RTMPEndpoint"/>
    <properties>
    <idle-timeout-minutes>20</idle-timeout-minutes>
    <client-to-server-maxbps>100K</client-to-server-maxbps>
    <server-to-client-maxbps>100K</server-to-client-maxbps>
    </properties>
    </channel-definition>

    There are seeral apps that play music over wifi or 3G
    Pandora, I(heart)music, Bing100, all free,

  • Audio Stream Recorder - Error: Audio device is already being used by another prog

    I realized that Audio Stream Recorder is does not "work" through server list feature. So I am simply trying to use the manual method of adding URL's to the interface. However regardless of the type of stream, shoutcast, windows media or real audio, I receive the error "audio device is already being used by another program". Does anyone know how to fix this? I have closed my audio application etc to no avail. <RANT WARNING> I was very excited about using this application when I read about it. However an application that provides none of the stated features is not an application, its false advertising, since it clearly states on the box, help files and website this products "features". Anyway, it'ss very disappointing. Also, does anyone know what the supported steaming formats are, the help file say the application requires RealONE and Windows Media Player but does not mention audio stream formats? Thanks you in advance for any help.

    I have the same issue. I updated to the latest software, to no avail. My first suspicion is that some Microsoft patch caused this, but I cannot verify this.
    Apparently no one at Creative is very interested in this issue.

  • IPhone 4S and iPhone 5 Running iOS 6.0.1 and A2DP audio streaming on a 2012 Lexus RX350 (Factory Car Stereo)

    Hello Everyone,
    Before the release of iOS6 and the iPhone 5, I was able to use the A2DP audio streaming on my car no problems and I was really a happy camper, when upgraded my iPhone 4S to the iPhone 5 (Which came already with iOS6) that funtionality did not work any more, I reconnected my iPhone 4s running iOS 5.1.1 and worked like a charm, then I thought my brand new iPhone has bluetooth problem , that same night (Release data iPhone 5 and iOS 6), I update my iPhone 4S and prepare it to give it to my wife, then It occured to me to go and test the phone back on the car but now Running iOS 6 and "viola", the phone did not stream audio via A2DP. So yesterday Apple Release a minor update for iOS (6.0.1) and after reading the release notes (which it did not say anything Bluetooth enhancements) and updating my iPhone, went and try to test again the phone and did not work. (No A2DP audio streaming), Definatelly there is a problem, I called iOS Tech support and open a Case.  Here are the screenshots for the iphone and car stereo.
    Iphone:
    Car Stereo:
    Phone (Voice Feature) works fine with the car.
    This happens when trying to Connect the phone manually.
    If anyone had this problem in the past and solved, please let us know.
    Thanks
    Rommel J. Jimenez

    I had this problem with my iPhone 4 after upgrading to ios 6.0 (10A403).  I called apple support and was given a fix for my problem.  The Apple support rep had me do a reset on my Iphone.  The iPhone then worked with streaming music through bluetooth to my Lexus and also now works with the usb tether.  I did not have to delete the pairing, but that certainly wont hurt.

  • C# Webbrowser using VLCplugin to play online audio stream

    Hello all,
    I have been trying to get the VLC to play a audio stream from a URL address.
    I created a forms application and added a webbroswer from the toolbox. I can navigate no problem but if I goto a link like
    http://audio.wgbh.org/otherWaysToListen/wcai.m3u
    I get a popup dialog that asked do I want to open this file. If i accept VLC opens and it plays no issue.
    However, what I want is it to play without the popup and in my application not with the VLC installed on my computer.
    I have seem many things about VLC selecting files but I have not been able to find a reference for pulling a stream with my C# form when browsing with the webbrowser item on my form.
    Any help would be thankful.

    Hi Badidea,
    >> However, what I want is it to play without the popup and in my application not with the VLC installed on my computer.
    Do you want to open the url without the popup? If so, I think you could block downloads from the webbrowser control, the link below shows the details:
    # How to block downloads in .NET WebBrowser control?
    http://stackoverflow.com/questions/483262/how-to-block-downloads-in-net-webbrowser-control
    But with this way, I am afraid that you could not open the audio. If you want to open the audio without the popup, I think you could automatically download the file, more information you could turn to the link below:
    # Suppressing the Save/Open Dialog box in a WebBrowser control
    http://stackoverflow.com/questions/3538874/suppressing-the-save-open-dialog-box-in-a-webbrowser-control
    But if you want to open the audio in your application without the VLC, I am afraid that you could not achieve that. As you know, the audio needs the special player from the URL, I think it is restricted if you want to open the audio without the player.
    Sorry for the inconvenient.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Does my new XBR65X900C support 5.1 audio streaming with Netflix?

    Hello, Does the XBR65X900C support 5.1 audio streaming via the optical output or ARC via Netflix or Amazon in 4K? I've tried connections to my receiver via ARC and also via optical, and the TV: - In Netflix never shows "5.1" as an option- Only outputs two channel in Amazon On the receiver I've tried two of the three audio options:- "Auto 1" setting, which outputs compressed audio with no changes- "PCM" setting I didn't select "Auto 2" at first which seems to be the same, but sends compressed, multi-channel audio with no changes but I'm assuming it would have no effect given the wording implies it simply sends two channel audio compressed without encoding. I did subsequently try the "Auto 2" setting, but it had no impact on the issue. I did try the same receiver (Onkyo TX-NR1030) with an LG TV and it receives a 5.1 source from the same Amazon account. The manual suggests the TV does in fact support streaming audio in 5.1, but I cannot seem to activate this on the TV. Please advise,Matt

    I have just bought the KD55X8500C on Saturday, only to find that the TV doesn't have 5.1 for Netflix.  I am yet to try google play movies, but from what I am seeing, I'm not holding my breath. It's 2015 SONY!! How can a $3k TV be sold that can't do 5.1 sound on streaming services, and no where on your site or in merchandising material to you highlight that this is a limitation of the TV. I want a Sony rep to tell IF this going to be fixed, WHEN it is going to fixed, or if not, where do I get approval to return my TV for a full refund so I can go buy a SAMSUNG that I know can do this. Again wont hold my breath - in Australia the tech support phone line is only available from 8am to 6pm on weekdays!! So only unemployed people can get support!

Maybe you are looking for

  • Is there any way to create a custom timecode in Premiere Pro?

    I mean going beyond the standard controls in the Timecode effect. I have a video project where I need to actually show time elapsed to demonstrate a process happening in a timelapsed video. In other words, this isn't just for editing/syncing purposes

  • No dictation option on keyboard screen

    I want to dictate to my iPad3 and am connected to the Internet. I followed the advice of going to SETTINGS>GENERAL>KEYBOARD. Once there I found no DICTATION option. Using iOS 6.

  • Help! Imac to Imac, Ipad2 to imac woes

    Recently bought new Imac so arranged through local yoobee store to transfer files from old imac to new imac. Shock horrors, they call me to say old imac hard drive has "died" and they have since sent it away to see if files can be retrieved. I'm tryi

  • No of lines a Report has?

    Hi All, I have a list of 6000 report names with me. I need to do unicode conversion for these reports and we need to estimate the time for that. For that one parameter to consider is to find out the number of lines each program has. I can open up eac

  • Clearing after a padded div?

    Hi, Can anyone help with advice re: 'clearing' the div after a 'padded' div tag? I can't seem to get it to work in firefox browser (its' okay in ie browser) Here's  my code; (I just cut out the affected area of the code below, the entire url is http: