Audio Queue Services Elapsed and Total Time

Does anyone know how to get the elapsed and total time of a file being played using Audio Queue Services? I am using a .caf file and it plays without a problem but I can't seem to figure out how to display the elapsed and total time of the audio file.
On a side note, I'd like to hook up a scrubber (like the one in the voicemail section of the Phone app). Does anyone have any idea how to set the playback position of an audio file?

Hi, Shindigg,
Does your code works after performing fast forward/rewind?
I got an awful result.
After I performing ffw or rwd, the mSampleTime is not the exact time which had been played, it always returns the total played time.
For example, I clicked the ffw button when playing at 10secs, and mean to jump to 20secs, the AudioQueue did jumped to the 20secs, but the mSampleTime still remains to 11, 12, 13secs....
Did you got a similar problem? If so, how did you resolve it?
Thanks
-Tonny

Similar Messages

  • Looping audio with Audio Queue Services..

    I've been using propertyListenerCallback to listen for when the audio stops playing and then load the audio back up again to loop it.
    The only problem with this is that it creates a short little gap in the loop and it's not seamless. Is there a better way to do a seamless loop?

    They shouldn't change unless the read was unsuccessful. The variable you need to worry about is the current position in the file and how close it is to the end.
    Say you're reading 512 bytes each time through the loop and your file is 1025 bytes long, you'd expect to make 3 total trips through this completely uncompilable pseudocode:
    fpos = 0;
    buffer = char[512];
    bytesread = 0;
    file = open("myfile.aiff");
    while ( file.read(sizeof(buffer), &buffer, &bytesread) )
    //Set new position in file
    fpos += bytesread;
    //If we're at the end, reset
    if ( fpos >= file.eof() )
    fpos = 0;
    //If we ran out of data, get some more
    //from the new position
    if ( bytesread < sizeof(buffer) )
    file.read(sizeof(buffer) - bytesread, &buffer, &bytesread);
    The first two times bytesread will be 512. The third and final time it will only be 1 and you will have reached the end of the file, so you go back and get the other 511 bytes you need to feed the larger ring buffer from the beginning of the file.
    If your file was an even multiple of your buffer size--like 1024--bytesread will NEVER change unless something goes horribly wrong.

  • External Services Management and HR Time recording

    Hi all,
    On the Service Master is a "wage Type" field and on the service lines in the PO and Service entry sheet a Personnel number with date/time entry fields.   Is the purpose to record "internal" personnel's time as part of an external services provided and can this in some or other way be transferred to the HR module to pick it up per personnel number?
    We have the requirement under South African law, to print certain tax certificates for labour brokers and saw the wage type and personnel number fields, but can't find ANY documentation on it!  
    I would really appreciate any help!
    E

    see the link for the help
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/8a/9868bc46c411d189470000e829fbbd/frameset.htm

  • Easy way to delete large chunks of audio by entering start and end time?

    I am removing segments from within an audio file. Right now I select the part I want to cut out using the mouse. Is there a way to delete exact portions by entering start and end times? For example, delete the audio from 5:03 to 7:16.
    Is this possible?
    Thanks!

    At the bottom of the track window at the left hand side ( bit above the loops window etc ) is a little slider. Look carefully, it is in line with the left control portion of the tracks at the bottom. Slide far left and see the whole of the song, slide right zooms in ........

  • IPhone Audio Queue Services MP3 Playback

    I have created a small sample app to play back an audio file. It seems that my playbackCallback it only being called 3 times for each buffer and then never called again. I followed the SpeakHere application but still no luck. Any tips or helps anyone can provide would be much appreciated. I am using an iPhone simulator but same result son iPhone with 2.0 software.

    I found out that it works fine with wav files.

  • How to display the time length of video (current time/ total time) ?

    Hi,everyone. I would like to ask how to display the time length of the video which show only in system example: it show the current time and total time? using AS 3.0.
    It there any information or solution to solve it? .
    I appreciate it any of you able to answer it. ^^
    Thank you.

    Hi,
    Actually I have this requirement for MAC OS 10.5. With the code you provided, I got the output as "6289375". When I changed the URL to point to my file (file:///Users/VPKVL/Desktop/MyRecord/tempAudio.wav), I am getting the below mentioned Exception:
    Exception in thread "main" javax.sound.sampled.LineUnavailableException: Failed to allocate clip data: Requested buffer too large.
         at com.sun.media.sound.MixerClip.implOpen(MixerClip.java:561)
         at com.sun.media.sound.MixerClip.open(MixerClip.java:165)
         at com.sun.media.sound.MixerClip.open(MixerClip.java:256)
         at TestWavLength.main(TestWavLength.java:13)The "tempAudio.wav" file is created by using java sound API. I am using the SSB USB Headphone Set to record the audio with the following settings for AudioFormat object:
    AudioFormat audioFormat = new AudioFormat(
              AudioFormat.Encoding.PCM_SIGNED, // the audio encoding
                                                            // technique
              48000.0F,// sampleRate the number of samples per second
              16, // sampleSizeInBits the number of bits in each sample
              2, // channels the number of channels (1 for mono, 2 for
                            // stereo, and so on)
              4, // frameSize the number of bytes in each frame
              48000.0F,// frameRate the number of frames per second
              false); // bigEndian indicates whether the data for a single
                            // sample is stored in big-endian byte order
                            // (false means little-endian)Can you please suggest where I am going wrong ?

  • How do you start 2+ audio files playing at the same time?

    I am trying to play 2 audio files at the same time, but I cannot figure out how to start them playing at the same time without latency issues.
    If someone can please explain the process for doing this using Audio Queue Services, I will forever be in your debt.
    This is for iPhone, but I was getting no love in those forums on this issue.

    Thanks for your reply. Apple's iPhone Application Programming Guide states the Following:
    *Playing Multiple Sounds Simultaneously*
    To play multiple sounds simultaneously, create one playback audio queue object for each sound. For each audio queue, schedule the first buffer of audio to start at the same time using the AudioQueueEnqueueBufferWithParameters function.
    This leads me to believe that it is possible. I have just not been able to get them to play precisely the same time, there is always delay.

  • Audio recording in memory and not on disk...

    Hi all,
    after searching on Apple reference I found that it's possible, using Audio Queue Services, to record not only on a physical file (ref: Audio Queues Services Programming Guides).
    I saw the SpeakHere example and some other threads in this forum, but all are recording on a file...
    What paremeter I have to pass to the recording callback function instead of the pathToFile or the AudioFileID?? I'd like to have a in memory buffer (byte array, or something similar...)...
    Any Help??

    First question: 192 bit audio -- does iDVD support this?
    I thought i heard that iDVD8 was supposed to support MPEG muxed?
    If not, your best bet is MPEG Streamclip - free from Apple
    Tho you MAY need:
    1. QTPro &/or
    2. MPEG2 plugin) to do what you want. -
    Streamclip has several 'demux' commands (I can't speak for whether or not this touches/degrades video - but seems likely not.. ).
    I really think iLife is fabulous -- but Apple makes it REALLY difficult to figure out what these Apps support & Worse how to get from point A to B without degrading quality.
    HTH - xandra
    Please post back if you find a solution.

  • My Iphone 5(purchased in Jan 2013) has suddenly developed a multicolored hue in the center of the **** screen. it looks pathetic and totally whacked out. Its rainy and humid where I stay this time of the year. Apple guys are you reading this?

    my Iphone 5(purchased in Jan 2013) has suddenly developed a multicolored hue in the center of the **** screen. it looks pathetic and totally whacked out. Its rainy and humid where I stay this time of the year. Apple guys are you reading this? does the management go through this website.? Hey Apple guys, can you replace my phone for me.Its so slippery and slides out very easily from my hands. I have owned smartphones before but yours is a real slimy slider. so while I was shooting pics in varanasi in march it fell out of my palm (it was drizzling) and the rear screen (the section next to the camera) kinda cracked real ugly and obviously due to this the camera is behaving kinda crazy too. can you guys help me out here.?

    If your phone is defective (aside from the accidental damage) Apple will fix or replace the phone. You saud you purchased the phone in January so it is still under warranty. 
    If you have an Apple Store in your area, make a Genius Bar appointment.
    If not, Contact Apple Service Center:
    http://support.apple.com/kb/index?page=servicefaq&product=iphone

  • IB Queue: Can a Queue be Unordered and Partitioned at the same same time?

    Hi,
    My question is related to Unordered Queue:
    Can a Queue be Unordered and Partitioned at the same same time?
    From PeopleBooks: Managing Service Operation Queues
    "Unordered:
    Select to enable field partioning and to process service operations unordered.
    By default, the check box is cleared and inbound service operations that are assigned to a queue are processed one at a time sequentially in the order that they are sent.
    Select to force the channel to handle all of its service operations in parallel (unordered), which does not guarantee a particular processing sequence. This disables the channel’s partitioning fields.
    Clear this check box if you want all of the queues’s service operations processed sequentially or if you want to use the partitioning fields."
    This seems to indicate that Unordered queues don't use partitioned fields. Yet, there are a few delivered Queues that are Unordered and have one or more Partition fields selected.
    EOEN_MSG_CHNL
    PSXP_MSG_CHNL
    SERVICE_ORDERS
    How does partitioning work in this case? Or is partitioning ignored in such cases?
    Thanks!

    I guess you could use reflection and do something like the following:
    import java.lang.reflect.Constructor ;
    import java.lang.reflect.Method ;
    public class MyClass<T> implements Cloneable {
      T a ;
      public MyClass ( final T a ) {
        // super ( ) ; // Superfluous
        this.a = a ;
      public MyClass<T> clone ( ) {
        MyClass<T> o = null ;
        try { o = (MyClass<T>) super.clone ( ) ; }
        catch ( Exception e ) { e.printStackTrace ( ) ; System.exit ( 1 ) ; }
        o.a = null ;
        //  See if there is an accessible clone method and if there is use it.
        Class<T> c = (Class<T>) a.getClass ( ) ;
        Method m = null ;
        try {
          m = c.getMethod ( "clone" ) ;
          o.a = (T) m.invoke ( a ) ;
        } catch ( NoSuchMethodException nsme ) {
          System.err.println ( "NoSuchMethodException on clone." ) ;
          //  See if there is a copy constructor an if so use it.
          Constructor<T> constructor = null ;
          try {
            System.err.println ( c.getName ( ) ) ;
            constructor = c.getConstructor ( c ) ;
            o.a = constructor.newInstance ( a ) ;
          } catch ( Exception e ) { e.printStackTrace ( ) ; System.exit ( 1 ) ; }
        } catch ( Exception e ) { e.printStackTrace ( ) ; System.exit ( 1 ) ; }
        return o ;
      public String toString ( ) { return "[ " + ( ( a == null ) ? "" : a.toString ( ) ) + " ]" ; }
      public static void main ( final String[] args ) {
        MyClass<String> foo = new MyClass<String> ( "zero" ) ;
        MyClass<String> fooClone = foo.clone ( ) ;
        System.out.println ( "foo = " + foo ) ;
        System.out.println ( "fooClone = " + fooClone ) ;
    }

  • T420s: Conexant Audio Message Service consumes a lot of CPU time in Windows 8

    Hi,
    I have here two models of T420s running Windows 7 and Windows 8.
    The Windows 7  model is quiet and the Service Needs no cpu time during idle.
    The Windows 8 model is noisy (the fan is Spinning) and the Conexant Audio Message Service (Version 1.6.0.0) is consuming 30% of cpu during idle.
    Any suggestions?
    Solved!
    Go to Solution.

    Pretty sure you can just disable the service. I did on my W520 with no ill effects.
    W520: i7-2720QM, Q2000M at 1080/688/1376, 21GB RAM, 500GB + 750GB HDD, FHD screen
    X61T: L7500, 3GB RAM, 500GB HDD, XGA screen, Ultrabase
    Y3P: 5Y70, 8GB RAM, 256GB SSD, QHD+ screen

  • Audio Stream - Total Time

    How to find total time of Wave audio(.wav) ?

    If you're using eight tracks, and four do not conform to the sequence settings, you're using the equivalent of 12 tracks of audio. You could try getting temporary relief, if your computer is fast enough, by going to FCE preferences and changing the number of real-time tracks to something higher, say 24 tracks.
    The other thing you might want to look at is to see why some of the tracks don't conform to the sequence settings. Maybe the mini disc material is at a different sample rate, or some of the cameras are not using the same sample rate, or one of them is a Canon camera and the sample rate is drifting. The application works best if all the material conforms to the correct format, AIFF, and sample rate before it's brought into the application.
    You can also select individual items that need rendering and render them at Item Level. You'll find this in the Sequence menu. This is fine for most material. Low quality, heavily compressed material like MP3 does not produce great results doing this.

  • I cannot receive email properly now. When I open mail, it says that is downloading about 1,700 emails. At the very end, it gives me my newest ones. But this takes a long time. I've contacted the Internet service provider and verified all the right setting

    I cannot receive email properly on either my IPad or my IPhone. I have had them for over a year and they have always worked fine. Until three days ago, when they both started acting up. On the IPad, when I open mail, it says it is downloading about 1,700 emails. At the very end, which takes quite a while to get to, I finally get the most recent ones. The IPad is sending emails just fine.
    On my IPhone, when I open mail, it says it is downloading 100 emails, but it doesn't do that. And it gives me no new emails at all. The IPhone is sending email just fine.
    I have already deleted the email accounts on both devices and reinstalled them. I've contacted the Internet service provider and verified all the right settings. The Outlook email on my desktop is working perfectly.

    WMV is a heavily-compressed format/CODEC, and the processing time will depend on several factors:
    Your CPU, which is not that powerful in your case
    Your I/O sub-system, which is likely a single HDD on your laptop
    The source footage. What is your source footage?
    Any Effects added to that footage. Do you have any Effects?
    Each of those will have an impact on the time required.
    The trial has only one main limitation - the watermark. Now, there are some components, that have to be activated, but are not with the trial, but they would be evident with Import of your source footage, if it's an issue.
    Good luck,
    Hunt

  • I'm trying to download office 365 small business package, and every time I try the website it says there is a runtime service error in the '/' application. Is this my mac or is it the website, and how can I fix it?

    I'm trying to download office 365 small business package, and every time I try the website it says there is a runtime service error in the '/' application. Is this my mac or is it the website, and how can I fix it?

    If a phone is sold from one friend to another and wants to use it on a different carrier the friend can contact the carrier it was sold by to request it unlocked.  I know AT&T, Verizon, and Sprint will give you the steps to unlock it as long as the original contract it was bought under has been completed.  eBay/Craigslist is really not the best place to try to get "unlocked phones" from, if it turns out the phone isn't unlocked then I'm really sorry you got stuck with that one and as stevejobsfan said above I would report them immediately and see if you can recover your money.  I sell phones for a living and this happens a lot

  • Multiclips and multiple audio tracks playing at the same time

    I've only just taken delivery of my first ever mac (only ever used PC) with FCP, and I'm loving it already! Done lots of reading and viewing of video etc etc, and it's not as daunting as I thought it might be. I have one question the books don't seem to answer, and I can only find one reference to this on this site, with no definitive response. FCP5 probably doesn't work this way, but just in case someone knows different......
    I film and edit motorsport (karting) programmes for television in the UK, using multiple cameras. I usually lay all the video and audio tracks on the timeline, (synched) lock the audio for each (as it is engine noise, and I want it playing without abrupt changes at cuts as each kart passes each camera, whether in shot or not) then cut the video tracks and delete those video segments not required.
    The most exciting aspect of FCP5 for me is the multiclip editing facility, which I have found very easy to learn and is going to save me hours of work! However, I want to know if there is a way of having each audio track from each camera used in the multiclip laid down on the timeline when you import the multiclip to the timeline from the viewer, in order that I can play each audio track from each of the cameras at the same time.
    I know how to cut from angle to angle, leaving the audio from the selected angle as the one audio track playing, but I want all of the tracks to appear in the timeline and play at the same time. I know there's a bit of a workaround by locking the video and importing each audio track from each clip independently, but if you do have to re-synch one of the multiclips, this means the audio is not then synched with the original clip, which will have had an in point set before being imported in as part of a multiclip.
    I can understand why you might want to keep audio from one camera only playing over the whole multiclip, or to switch between audio from each, but in my case I prefer all audio to play at the same time. The workaround is still do-able for me as I'm only talking about engine notes, which if they are a few frames out is not very noticeable at all, but I would like to know if I'm right in thinking I cannot do it the way I would like to?
    Wish I'd used FCP from the start, but glad I've got it now.....especially with the 30 inch screen! It's 4.40am, been going over 19 hours straight and I'm still making comments like...."WOW, that's brilliant"...every half hour!
    G5   Mac OS X (10.4.3)   Quad, 8gb ram, 2 x G-Media GRaid 500gb Raids, 30 + 20 inch Cinema screens

    ...

Maybe you are looking for