Getting audio file properties (length and size)

Hi,
when I load a screen I have two labels. One should display me the audio file length (in seconds) and the other the size (in MB).
But I cant get it to work. The labels just show me '(null)' all the time.
What am I missing here?
@interface AudioViewController : UIViewController {
NSString *size;
NSString *length;
IBOutlet UILabel *audioSize;
IBOutlet UILabel *audioLength;
-(UInt32)audioFileSize: (AudioFileID)fileDescriptor
//Get file size
UInt64 outDataSize = 0;
UInt32 thePropSize = sizeof(UInt64);
OSStatus result = AudioFileGetProperty(fileDescriptor, kAudioFilePropertyAudioDataByteCount, &thePropSize, &outDataSize);
if(result != 0) NSLog(@"cannot find file size");
NSLog(@"file size: %@", result);
return (UInt32)outDataSize;
//Get file length
NSTimeInterval seconds;
UInt32 propertySize = sizeof(seconds);
OSStatus err = AudioFileGetProperty(fileDescriptor, kAudioFilePropertyEstimatedDuration, &propertySize, &seconds);
if(err != 0) NSLog(@"cannot find file length");
NSLog(@"file length: %f", seconds);
size = [NSString stringWithFormat:@"%i", outDataSize];
length = [NSString stringWithFormat:@"%f", seconds];
- (void)viewWillAppear: (BOOL)animated {
audioSize.text = [NSString stringWithFormat: @"%@", size];
audioLength.text = [NSString stringWithFormat: @"%@", length];
Thanks for your help!

you should not attach sounds to timelines if you want precise control of your sounds, and use actionscript. 
that said, your sound will play if you assign its sync property to event, instead of stream.

Similar Messages

  • Quality manager QMQU0003 The audio file is invalid and cannot be played

    Hi,
    I've client using Cisco QM 8.5. There is a recording dated 21st November, 2011 for one agent which he is not able to play back. The agent took many calls that day and all the recording are getting played back except one. The duration of call in question is shown as 37 minutes but the file size is 0KB.
    The error client gets while trying to play back is:
    QMQU0003 The audio file is invalid and cannot be played
    The recording is important to the client. Can someone pl comment what could be done to retrieve it and what could have caused it?
    I looked at Event Viewer on Agent PC, unfortunatley there aren't any entries since 8th November to 22nd November. The PC was rebooted on 22nd November and all event viewer is getting updated correctly now.
    I am attaching the screen-shot of error in case someone is interested in seeing.
    Thanks in advance,
    inner_silence

    Thought of updating the case with current status.
    Got some help from Calabrio and the engineer identified a known bug in QM 8.5.1 release.
    The Bug ID is: CSCTK75463
    Fix will be in QM 8.5.2.
    Checked CTIService debugs and found that the agent received a transferred call and the customer has Immediate upload turned on. As a result of this they unfortunately ran into the timing issue which is fixed in 8.5.2.

  • How to access iPhone "Photo Library" to get image file properties?

    I want to access iPhone "Photo Library" to get image file properties(name, list etc..) without dialog.
    Is there any suitable method/class to this?

    Allan,
    Thank you for your reply!
    My purpose is access to "Photo Library" by iPhone API.
    Because, I know several iPhone application which has own image list and the list is synced to "Photo Library".
    If I take photo by iPhone native camera, the taken photo is listed up on the image list so I guess those applications can access to "Photo Library" directly.
    Or.. any other solution..?
    Gazza

  • File is huge when combined or changed to PDF, how do I get the file to a normal size to print?

    Files are to large to print once they are PDF, how do I get them to a normal 8x11 size to print?

    So why is it when I send these PDF files to clients they are to large for clients to print?
    If I send a combined PDF file that is 3817KB, which a client has said is to large for them to print.
    I send it to our office manager, she will print it, scan it back to me as a PDF, it will come
    back as 375KB, the client can then print the file.
    My question is, was/is there something I need to change in the process of scanning, combining files
    to PDF that would create a smaller size file when done?
    Sorry for all the confusion
    Marilyn Bartunek
    Juffer Real Estate Inc.
    605-360-7703
    [email protected]
    Date: Tue, 1 Apr 2014 10:13:35 -0700
    From: [email protected]
    To: [email protected]
    Subject: file is huge when combined or changed to PDF, how do I get the file to a normal size to print?
        Re: file is huge when combined or changed to PDF, how do I get the file to a normal size to print?
        created by Test Screen Name in Creating, Editing & Exporting PDFs - View the full discussion
    Sorry, I'm lost.First I thought this was about page size. But you say it isn't. You say it's about file size.  You've combined files of 494 + 441 = 935 KB, and you get 944 KB. This seems fine and you say it is fine. So what is the problem? Are you now on still a third meaning of huge, about size on screen?
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6261540#6261540
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6261540#6261540
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6261540#6261540. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Creating, Editing & Exporting PDFs at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • I am trying to import quicktime audio files into FCPX and it's saying they're not suppored - Help?

    I am trying to import quicktime audio files into FCPX and it's saying they're not suppored … Help?

    Here is the How to import in itunes 11. Including the Join tracks option.
    http://support.apple.com/kb/PH12278
    Also if you have imported them then  this article gives a good understanding of how to tag these songs
    http://samsoft.org.uk/iTunes/audiobooks.asp
    the other option would be to use an App like Audiobook Builder to stitch the tracks together in upto 12 hour long sections and sends to itunes automatically. It is available in the App Store. There are others available, Audiobook binder is free

  • How do you get audio files to loop instead of playing just once.

    how do you get audio file to loop instead of playing just once.
    Thanks

    This forum is specifically meant  for Edge Inspect issues. Could you please let us know the product your query is related to. We will redirect you to the correct forum.

  • How do i get the file properties of any file in the phone?

    i need to get the meta data / properties of files in the phone.
    in addition, i will need the song title, artist, genre, etc information from video and audio files.
    can somebody help?

    but i cant seem to find any APIs Impl. would definitely complex.. as there are no stright api. matching your exact need (not sure if some third party has any library meeting your needs).
    that support the function of reading the whole file as the WHOLE file (headers + content).You could read byte by byte or set of bytes using read() and its overloaded method and store in byte[] array.
    It get the meaning full understanding of these bytes and get what you really need.. for the audio and video file, you need to go to the specification and read the bytes accordingly.
    if there are, then is there a way to rewrite the file?
    is there a way to change the bits in the file without creating a new one?Yes you could if you open the file with readwrite (look at Connector) mode and with OutputStreamWriter.
    Some of the challenges you would phase are memory issues, performance issues while reading big files..
    Regards,
    Raja Nagendra Kumar

  • 2 Questions: Missing audio files...and How to delete audio files

    I have two nagging issues associated with my podcast at iTunes.
    First, audio files are missing from the podcast. Everytime I post m4a files to my podcast, they are added to an xml file, and to the podcast. The xml file is complete, but some files are not making the trip to the podcast.
    Second, I have a need to delete some of the audio files which appear in my podcast. How do I do that?
    Thanks!

    As has been suggested you can encourage people to download QuickTime player by doing something like this...
    http://www.mirroroftheuniverse.com/Songs.html
    You can also present your songs like this...
    http://roddymckay.com/Satellite/JukeBox.html
    This is a SnoCap jukebox and you need an account to use it but you'll get the link to ESnips on the above page.
    A 3 minute song has a file size of about 30 Mb in AIFF format. Converting it to MP3 reduces it to about 3.5 Mb and M4A to about 5.5 Mb.
    iTunes will do these conversions for you and M4A is far superior to MP3 as far as sound quality is concerned.

  • Exported video file does not match audio file in length?

    I'm back with the same problem.
    Here are the specs for this project:
    Premiere Pro 5
    Footage shot in HDV 1080i (Sony FX1)
    Edited Timeline length...52:25
    Destination: Blu-ray disc
    I have tried both formats in the AME...MPEG2 Blu-ray and H.264 Blu-ray
    I have tried every combination of Presets within these two formats...Match Attributes, 1440x1080i, HDTV....etc, etc, etc
    The machine is spending anywhere from 7 hours to 27 hours to encode these files.
    When I open the two files after the operation has finished, I find I have an audio file 52:25 in length and a video file 43:34, no matter what format or preset I have chosen!
    Upon playback, you can imagine the frustration...within the first two minutes the two are out of sync.
    What am I doing wrong here.
    This is my first sortie into the HD world of Adobe. I've been doing  Adobe Premiere SD for 10 years...and my deadline for the closed captioning is coming way too soon.
    I appreciate any help you might offer.

    Jim...Yes! I just did that this morning in frustration and by golly, they are both the same length. There is a note in the Project window after I copy to "Timeline" that says the video file is unencoded! Wierd! Another problem popped up in that the video and audio files are in different sequences in Encore. I cannot get them to play together. One will play and not the other...? I can't seem to drag them to the same sequence.
    But, at least they are the same length! Mysteries in this HD business.

  • I just moved my itunes library from a win 7 computer to a win 8.1 computer. Getting an error message "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly. Can't play CDs or get audio file from web!

    Help! I just moved my itunes library from a Win 7 computer to a new Win 8.1 computer following the instructions on the itunes website. Everything is good except I'm getting an error message on the Win 8 computer if I try to play a CD or get an audio file off of the internet. I get an error message that says "iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly. I don't know where to look for or fix the audio configuration on the win 8 computer. As far as I can tell the iTunes configuration looks the same as on the other computers in the house. At this point I don't dare plug my ipod touch into the Win 8 computer for fear it will get messed up.

    I have the same problem and I know that it is due to my PCI Audio driver not being compatible with WIndows 8.1.
    iTunes isn't the only program that can't direct sound to the built-in speakers anymore. The obvious solution would be to update the drivers, but unfortunately Dell does not provide an updated driver for my model, so I am stuck with that.
    However, saying that, only my laptop speakers are affected by this. I can use sound fine on applications where I can choose the output device and direct sound to the head phones, but for some reason iTunes does not let you choose the audio device manually.
    To listen to music I imported the iTunes Library in Windows Media Player and changed the audio output using the following instructions: http://windows.microsoft.com/en-us/windows7/c00d11ba
    However, I would also like to rent movie's from iTunes, 
    Would be great if iTunes would let you choose the output device, too, like most other applications using sound  from Skype to Windows Media Player,...

  • Get "EXE File properties"

    I would like to get the follwing "File properties" from an EXE File
    - Original Filename
    - File version
    like if you "right klick" on a EXE File and than
    klick on "properties".
    How can I get these information with JAVA.
    thanks
    Aykut

    Hmmmmmm I doubt you would find a specific example using JNI for what u asked....so do a search for JNI on here.
    Then I would look at microsoft.com to see what API functions are used to get the information you desire.

  • How to get audio files to play on iTunes

    So i've been rendering audio files recently and tryring to get them to play on itunes. Once the files are on my desktop i don't know how to get them to play on itunes. I tried right click opening them in itunes. I've also tried draging and dropping them with .mp3 and .m4a but i don't know what else to do. Pls help

    What format?  Will they even play in Quicktime Player?

  • How to get audio files to follow project tempo??

    Im tryin to figure out how to get my mp3 audio files to follow project tempo and transition up or down to any specific tempo.. is there any way of doin it? thanks

    Hi,
    Yes, you need to convert them into Apple Loops. First, you have to convert them to either AIFF or WAV format (or use the original WAV). You can do that in the Audio Bin. Drag the converted file onto an audio track.
    In the Arrangement window select the newly created region of the audio file. In the Arrangement window menu under 'Audio', choose >Open in Apple Loops Utility...
    Next, take look at p 618 in the LP8 Manual 'Creating Apple Loops in the Apple Loops Utility'. That should/may get you there.
    regards, Erik.

  • Determine audio file play time from size

    Hello!
    I have a mp3 file and i want to determine it's play time from it's length. Is this thing possible? Could anyone point me in the right direction?
    Thanks in advance!
    Cheers!
    Radu

    Thanks you both for your replies!
    I posted yesterday late in the evening and my brain didn't work quite well :)). After i've read your posts today, i realized that i will be using mplayer in slave mode to play the audio file, and a quick google search showed me that mplayer offers a way to retreive the play time of any audio/video file (in seconds). Tested it today and it works! So i guess my question has been answered.
    Thanks again
    Cheers!
    Radu

  • Reading File name, mimetype and size from FileUploadUIElement

    Hi,
    I am using FileUploadUIElement and I need to read filename, type and size in my Button click action.
    I have seen the standard Test UI  elements component WDR_TEST_EVENTS which does this in wdDoModifyView method.
    But is there any way to read them outside wdDoModifyView ? In a normal custom action event?
    Thanks and regards,
    Amey Mogare

    Hi,
    Yes you can definately do the same in any of the custom events implemented.
    You will have to create a global attribute in the component controller say g_upload type ref to cl_wd_file_upload ( mark the Public checkbox ).
    " Now in your view modify instead of,
      file_upload2 ?= view->get_element( 'FILEUPLOAD2' ).
    " you say,
        wd_comp_controller->g_upload ?= view->get_element( 'FILEUPLOAD2' ).
    Now create an action for you button and copy the rest of the code from view modfiy and place it in this method,
    using wd_comp_controller->g_upload get the required values as follows.
    * get the content of the filename property
      filename = wd_comp_controller->g_upload->get_file_name( ).
    * get the content of the mime-type property
      mime_type = wd_comp_controller->g_upload->get_mime_type( ).
      wd_context->get_attribute( exporting name = 'FILECONTENT' importing value = filecontent ).
      size = xstrlen( filecontent ).
    Regards,
    Radhika.

Maybe you are looking for

  • Process Controlled Workflow - Process Schemas

    Hi I am configuring Process Controlled Workflow in SRM 7.0 for shopping carts. As per one of the guidance documents, I activated the BC Sets for the shopping cart in order to pull in all the component parts. As none of the three standard Process Sche

  • Mail Signature Issues (multiple)

    Cumulatively I have spend 20-30 hours trying to make a signature and continue to have issues (never see this experience in APPLE holiday commercials!). I have researched this Board and there are a few cross-overs, but I am including them all here to

  • Not charging; it's beeping.

    I have not charged my iPod for a little while, maybe a couple of weeks, and I haven't listened to it for around 3 days. I went to charge it tonight, and the apple icon showed up like a normal resetting. For a few moments, the backlight was on and it

  • How does it work BufferedImage ?

    This code that I have copied from Sun docs examples doesn't work.There is a NullPointerException using the buffer... Why? Thanks in advance,regards Lando. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> java.lang.NullPointerException a

  • Recovery in the device deleted by mistake

    I bought the device with Windows Recovery in the device  deleted by mistake ... Now, do not possess any method of retrieval system What do I do  ???? Please help  ,, Unfortunately, the mistakes expressive