Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2003

    How to calculate audio data's length in seconds

    I'm a bit confused now as my formula is giving me different results when compared to what I hear from the device. I have a file that holds raw audio data recorded with CMdaAudioInputStream (8kHz, mono). As far as I understand CMdaAudioInputStream will record in 16 bit.

    The formula that I'm using is as follows:

    File size = (Sample Rate) x (Number of Tracks) x (Word Length/8) x (Song Length in Seconds)

    word lengths are typically 16, 20 or 24 bits. And I know that in Symbian it's 4 bytes.

    So, if my file holds 33600 bytes, then according to that formula the sound should last for 1,125 secods when streamed using CMdaAudioOutputStream. However this is not even close, as it lasts more like 3 seconds.

    How do you calculate in Symbian how long some file will play, so that you can set e.g. progress bar's right.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003

    you could use CMdaAudioPlayerUtility and use Duration-function to check the length.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts