Listeners for when audio file finish

I'm using the AVTransmit2 sample java code to send audio to a client. Is there a way to tell when that audio file is finished? I want to set up AVTransmit2 so it randomly plays another audio file once the first audio file is finished. I looked into listeners but I couldn't really figure out how to set them up to work with what I have. I think I need a listener to tell me when the audio file is over, but I can't figure out where it should go and what to make the listener listen to. I wrote some pseudocode to describe what I think I need.
**Pseudocode
if ( player.listener = event.stop){
x = rndnumgen();
player(x);
The main() method in AVTransmit2 has a line:
AVTransmit2 at = new AVTransmit2(new MediaLocator("file:/C:/test.wav"),
                         ip, port, fmt);
The problem is that I don't think AVTransmit2 has a player like the client does so I don't really know where to put the listener, if anybody has any suggestions I would be much obliged.
Many thanks,
Wade

You need to implement a ControllerListener, register it on your Processor, and listen for an "EndOfMedia" event.
It's important to note that once a Processor or Player have begun to process, you cannot change the DataSource they're using to play. You can't just tell the Processor "Ok, play this file now" without stopping it, and when you stop it, it'll kill the RTP session.
[http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/Concat.html]
In order to do what you're wanting to do, you essentially need to use the Concat example to create a DataSource that will act like a jukebox... when one song ends, the DataSource will switch over to start outputting the new song. This way, the Processor itself doesn't have to change DataSources, so you can maintain the RTP session continuously.
It's also important to note that a specific Processor instance is probably only capable of processing the kind of data it's processing. If you're processing a MOV file, you probably couldn't use the same Processor instance to process an AVI file after that. So, it's important that all of the data that comes out of your jukebox DataSource is the same format, which you can do by embedding Processor's inside the DataSource. This is actually how the example has it implement, so I'm really just explaining why the example does it that way.

Similar Messages

  • Download Taskbar now flashes when a file finishes instead of when it starts the download

    I just recently upgraded to Firefox 8.0. In the previous version, when starting a download, the taskbar would flash as the download began. Since updating I've noticed that the taskbar now flashes orange when the file finishes downloading. While I understand that this may be useful for many, if not most, folks, I'd really prefer to change the timing so that the "alert" happens as a download begins. Is this something I can adjust, or is this behavior "hardwired" into FF 8?

    You mention changing some settings. What were they?
    You could try turning off integrated virus scanning. This assumes that you have real-time virus scanning of files added to the file system via McAfee or another product.
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the filter box, type or paste '''scan''' and pause while the list is filtered
    (3) Double-click '''browser.download.manager.scanWhenDone''' to toggle its value.
    Besides the obvious -- that this setting points your AV software at the file -- it also marks the file as sourced from the web, which causes Windows to apply certain security restrictions to the file. If you find that this change resolves the issue, the file disappearance might have been due to your IE security settings for the Internet zone.

  • To calculate Header size for an audio file.

    HI ALL
    Iam displaying the wave form for an audio file opened(.wav, .au ...etc) and doing any edit operation (cut for example) my waveform is shown with extra header (bytes) added to this wave form, i want to get rid of this. That's why i want to calculate the Header Size, which i heard that header size is not constant for all the files(even same two .wav files).
    Any Ideas will be appreciated.
    Thanks
    kalpana.

    find the documentation for the .wav file format :P

  • Unable to locate a default player for iTunes audio files in Windows Vista

    I previously owned a Compaq and saved my music in an external storage and worked perfectly. I then purchased a HP with Windows Vista and now am having problems with iTunes. The new computer indicates that iTunes has detected that is not the default player for audio files. It gives me a selection of file extensions, "iTunes music database files", "iTunes music store URL", "M3U Audio Playlist", "MPED4 Audio Files", and others in Windows Media Player. Which one should I select? Thanks
    Joe

    I created a config file (which is very handy in deployment and debuggin) that contains the class name and other additional parameters that is available in the optionsMap inside the LoginModule.
    My Config file looks like :
    DatabaseAuthenticate {
    com.mahesh.research.jaas.auth.CLoginModule required debug=true database.userid="matest" database.password="matest" database.driver="oracle.jdbc.driver.OracleDriver" database.url="jdbc:oracle:thin:@den-dev-2:1521:trexdev" ;
    and i have an entry in the policy file
    grant{
    permission java.util.PropertyPermission "*" , "read, write" ;
    when running the application i specify the following VM Parameter.
    -Djava.security.auth.login.config ="file:/D:/Research/Jb6/JaasResearch/config/login.config"
    offcourse, the jar files in the classpath.
    When i Create a LoginContext and call its login() method, Everything works fine.
    you might wanna try this way and very important you need to specify all permission.
    if you are running under Security manager , try switcing on the debug option as -Djava.security.debug=access.failure that should give a hint on where the problem is.
    hope this helps

  • Viewing total duration for multiple audio files

    I need to be able to view 'total duration', when selecting multiple audio files, e.g. 10 audio files, total duration 42.03. I can't find a way to do this and so far, all I've been able to do is view individual audio file durations, then total them manually (which takes far too long, for what I need to do). I've previously been a Windows user, and this is instantly viewable in Explorer.
    I'm new to OS X, and really need to be able to do this for my job. Can anyone help??
    Thanks in advance, Marc

    Here's an image to explain better:
    http://img216.imageshack.us/img216/3241/playlisttotaltime.jpg
    However the total time isn't 100% accurate, because I believe iTunes is adding some extra seconds for the gaps in between songs.

  • Can't set parameters for embedded audio files using css

    I'm embedding numerous audio files in Dreamweaver CS3 using
    the <embed> tag. I'm using CSS to control the box size and
    other attributes relating to how the file displays on the page, but
    I'd also like to set the parameter "autoplay" to false, and
    controller to "true," for all of the audio files. I've been doing
    this individually for each file (very time consuming), because I
    can't figure out a way to do it with CSS. Is there a way to set
    those parameters in CSS and apply it to all files?

    .oO(teachAA)
    >I'm embedding numerous audio files in Dreamweaver CS3
    using the <embed> tag.
    >I'm using CSS to control the box size and other
    attributes relating to how the
    >file displays on the page, but I'd also like to set the
    parameter "autoplay" to
    >false, and controller to "true," for all of the audio
    files. I've been doing
    >this individually for each file (very time consuming),
    Search & replace exists.
    >because I can't figure
    >out a way to do it with CSS. Is there a way to set those
    parameters in CSS and
    >apply it to all files?
    No. CSS is for presentation, but these parameters belong to
    the HTML and
    have to be written there.
    BTW: The 'embed' element is invalid HTML. If you care about
    valid markup
    and your site doesn't have to be compatible with really old
    browsers
    like NN 4 or IE 5.5, then you should use the valid method
    using 'object'
    elements.
    Micha

  • Play back for Archived audio file

    First of all, forum users, please pardon my ignorance with Documentum...my first experience with this after many years in SAP.
    I don't see any posts or articles on this subject.  I'm attaching a WMA file to Documentum.  I need to be able to play that back, using the user's PC player, in this case Windows Media Player.  Has anyone seen documentation on how to call media player from frontend services and pass the audio file, or can you suggest the "best practice" for this?
    My PDFs display easily using ARCHIVOBJECT_DISPLAY, and I suppose I expected that FM to decide how to handle the file, but it seems to work only for PDFs, so far, for me.

    Found way to do...
    read file back from documentum
    download to desktop
    call frontend services execute.

  • Creating a Volume Control Bar for multiple audio files

    I'm fairly new to Flash and am developing a project with a
    series of frames that contain unique movie clips. Each of these
    frames are accessible through a chapter based menu as well as being
    viewable straight through as a regular movie. I've just added the
    audio for each "chapter" / frame that are all unique from one
    another. I'm having a problem with creating a volume control bar
    that will affect all audio throughout all frames from the single
    control bar on the general skin/interface that these chapters work
    out of. (Using Flash 8)
    I developed a sliding control bar, which works but does not
    affect the volume in any way. Is there something wrong with the
    following coding that I'm using? (The control bar is made up of a
    button nested in a movie clip and the action is being applied to
    the mc. The bar/line to follow is 60px long and the control is to
    move horizontally while the increase corresponds to increase in
    volume. The original code was for a 100px line from a macromedia
    tutorial that I adjusted to be 60px) Any advice on best practice
    for creating a volume control bar would be greatly appreciated! (I
    currently have all of my corresponding audio files on separate
    layers, should I be placing these within a mc rather than just
    having them on the main timeline?) Thank You!!!!

    Answering my own question.....
    Each individual swf has the code...
    var my_sound:Sound = new Sound();
    my_sound.loadSound("someSound.mp3", true);
    my_sound.setVolume(50);
    Code on Shell/main slide....
    //SOUND OBJECT
    var soundtrack:Sound = new Sound;
    soundtrack.setVolume(50);
    //END OF SOUND OBJECT
    //GLOBAL VOLUME CONTROL
    var nVolCheck:Number;
    volSlider.volBall.onPress = function():Void {
    this.startDrag (false, 0, 0, 75, 0);
    nVolCheck = setInterval(updateVolume, 150);
    volSlider.volBall.onRelease = function():Void {
    this.stopDrag ();
    clearInterval(nVolCheck);
    function updateVolume():Void {
    var vol:Number = (volSlider.volBall._x)*2;
    soundtrack.setVolume(vol);
    //END OF GLOBAL VOLUME CONTROL
    my bar is 75 pixels in width and the volume is being
    increased by 1.5 at its maximum.

  • Need Action When Flash File Finishes

    I have a flash file embeded in a jsp page....
    <OBJECT
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    WIDTH="320" HEIGHT="240" id="Yourfilename" ALIGN="">
    <PARAM NAME=movie VALUE="<c:out
    value="${myForm.resource}" />">
    <PARAM NAME=quality VALUE=high>
    <PARAM NAME=bgcolor VALUE=#FFFFCC >
    <EMBED src="<c:out value="${myForm.resource}" />"
    quality=high bgcolor=#FFFFCC
    WIDTH="640" HEIGHT="480" NAME="<c:out
    value="${myForm.resource}" />"
    ALIGN="" TYPE="application/x-shockwave-flash"
    PLUGINSPAGE="
    http://www.macromedia.com/go/getflashplayer">
    </EMBED>
    </OBJECT>
    When the flash file finishes. I want my page to redirect
    auto-magically to another web page. How do I do that?
    Is it possible to put a re-direction into the object
    header?

    insert a keyframe on the last frame of the action layer, then
    add this code into it:
    getURL("
    http://www.yoursite.com","_self");

  • Why does my slideshow freeze when audio file is attached?

    I've had this issue since I began using a Windows 8 desktop this past December. I am now on Windows 8.1, and have been since it came out. My machine is running the 64 bit version of the OS. I've got an intel i7 4770K 3.50 GHz processor and 12 gig of memory. I'm running LR 5.4, which I downloaded and have updated via the cloud.
    Here is the issue:
    When I try to run a slide show with an audio file, the slide show doesn't advance, and the audio doesn't play. It acts like I've paused the play back. It doesn't matter whether I use an MP3 file, or m4a. There is no message indicating there is a problem with the audio file. If I play the file outside of LR, it plays without issue. If I remove the file from the slideshow, the slideshow plays as expected.
    The only progress I've been able to make on this issue is that if I start up the slideshow, which causes it to act like it is frozen, if I press the space bar to pause it, and again to restart it, after about the third or forth attempt it will play. Not only can I reporduce the problem every time, I can reproduce the workaround I found every time.
    Has anybody else experienced this? Any thoughts on how to fix it?
    Thank you

    How much free space on the startup disk?
    Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. Make sure you always have a minimum of 15% free disk space.
    When you have problems updating software, that's a good time to check the startup disk. Launch Disk Utility  /Applications/Utiliites
    Follow instructions here > Using Disk Utility to verify or repair disks

  • After Effects Crash when audio file is dragged to layers panel, but not when dragged to comp window

    Ok, so this is an odd one, and as it has a work around its not a huge issue, but it would be good to get to the bottom of it.
    If I load an audio file of any type (wav, aiff, mp3 etc) into the project window everything is fine, however if I drag it down to the composition layers panel I get a crash.
    However, if I drag the file to the composition widow (to the right) this does not cause a crash, and now that this has loaded the audio file in question I can drag it freely wherever I like without a crash. However if I import a different audio file and drag it downward to the composition layers panel it crashes again.
    I am running cs5.5 upodated to the latest 10.5.1.2 and running Mountain Lion.
    Crash report

    Ok, so I figured out what is causing the crash... why I do not know.
    I had a background texture that was very large (5184x3456) that was hidden. If this layer was unhidden then it did not cause the crash, no other hidden layers caused the crash.
    I re-sized the layer in photoshop to comp size, then re-inserted this image. It now works without a problem.
    So I have solved my own problem here, would still like to know why it happened if anyone can shed some light on this?

  • Fast Forward & Rewind doesn't work for long audio files

    I have loaded several mp3 files into the Pre via USB.  Some are 2+ hours long, some are a few minutes.  Fast forwarding thru the track doesn't work on the long files.  Holding down the fast-forward arrows will cause the audio to stutter in the same place, sometimes go BACKWARDS instead of forwards, and eventually it will go silent.  Pressing Pause, Play, whatever won't bring it back and ytou have to start the audio file over.
    Help, Palm!
    Post relates to: Pre p100eww (Sprint)

    Yea, the fast forward is way lame and pretty much...
    You get the idea.
    mark

  • Has anybody found the fix for when audio stops working all of a sudden in FIrefox

    I DO NOT want to restart Firefox - and YES - I have RESET Firefox itself MANY TIMES - AND YES - I have the LATEST FIrefox - AND NO - I don't have any conflicting add-ins / extensions other than Fire FTP - and this happens ALL THE TIME - Does anybody know a workaround or a fix for this that won't mean restarting etc?

    ANY audio playing on ANY website through the Firefox browser - Chrome - is FINE so is IE - If I am plating audio through any other external source such as SoundForge or Adobe Audition - Fine - JUST through FIrefox - and this happens ALL THE TIME - ALL of a sudden - AND as i stated I DO NOT want to close my browser and restart - and have to save my tabs etc - AND again i have ALREADY reset Firefox - yet it still happens - Thanks

  • Firefox is causing my imac screen to go blank (crash) and I have to restart. Most of the time its random, but recently it did it everytime I finished listening to an audio file online. Is there a solution for this?

    Firefox is causing my imac screen to go blank & I have to restart. It's been happening randomly for weeks now. I haven't been able to tie an action that causes it. Firefox is open while I work in other adobe software. Recently it has done it every time the audio file finished that I'm listening to online and that makes me think it's tied to Firefox. Is there something I can do to fix this? For now, I am going to quit firefox while I work and see if that doesn't improve my situation for now.

    Does it still happen if you disable all plugins?
    Did it start happening after a Firefox update or a plugin update?
    *https://support.mozilla.org/kb/Troubleshooting+plugins

  • Echos in QuickTime audio file when I play a page in Keynote.

    I have a project that was created in Excel, placed into a PC Powerpoint program, and then sent to me, whereupon I placed it into my new Keynote program. I had earlier trouble getting the screen to stay open until the video was finished, so I decided to just get by with audio clips.
    I made one audio clip with QuickTime as practice. I saved the QuickTime movie. I placed that icon onto the Keynote page. Then I heard echoes of about 2, maybe 3 voices speaking and music which I thought I had deleted I swept the page for invisible audio files but found nothing.
    How can I take away the echo?
    ~ Lorna in Southern California

    1. System Preferences >  Flash Player > Advanced >  Delete  All
         Press the "Delete All" button
         Install Adobe Flash Player.
        http://get.adobe.com/flashplayer/
        Follow the prompts.
        Quit Safari.
        Restart computer. Relaunch Safari.
    2.  Allow  Plug-ins
        Safari > Preferences > Security
        Internet Plug-ins >  "Allow  plug-ins"
        Enable it.
        Press " Manage Website Settings" button for more options.

Maybe you are looking for

  • Extracting audio from a DVD theme????? to edit????

    I want to take the 16mm projector sound out of the "old theme" projector theme and put it in garage band so I can add a layer of music and then return it to the theme.... When I try to drag the sound file out of the theme or click it to save it just

  • How come the Adobe Wiki says Photoshop CS5 inclues Acrobat Pro 9.3 but mine doesn't include it?

    I was reviewing what is supposed to be included with Photoshop CS5 and it says it includes Acrobat Pro 9.3 but mine only contains Photoshop.  Mine is an upgrade from CS3 but should that matter?  The CS5 matrix shows CS5 contains 9.3 but mine doesnt?

  • NOT SOLVED - Unable to sync with Ovi at all.

    Update Edit : after the sync completed, Ovi came back with 'No Contacts Updated'.....Restart Nokia Ovi Suite.  Error code 83860036.  For a minute there, I thought it was sorted, but no. After a right runaround, with advice from Nokia support to unins

  • Multilevel base value and percentage

    hi, in AFAMS, there are columns like base value and percentage. i need to clarify the below. hope can get advice. 1) say base value is 01 (acquisition value), year = 8 and percentage 5.     in this case, meaning the depreciation cost is 5% out of the

  • SAP CRM Scope n Growth

    Hi Guys, I am SAP-ISU Consultant with 5 years of work experience and before coming to SAP, i had domain experience in SD for 3 years. Now the growth and scope for ISU is getting stagnated, i would like to move on from ISU to CRM in order to en cash u