Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. to calculate the Time of Playing an Audio file

to calculate the Time of Playing an Audio file

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shiva shankar
    wrote on last edited by
    #1

    plz can any one help me in calculating the time, that will be taken in playing the audio file using c or vc++ program.

    D 1 Reply Last reply
    0
    • S shiva shankar

      plz can any one help me in calculating the time, that will be taken in playing the audio file using c or vc++ program.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Near the beginning of the file is some header information. One of the fields is the average bytes per second (i.e., sampling rate). Divide this into the size of the file to get the approximate play time. For example, the The Microsoft Sound.wav file is 135,876 bytes in size and has a sampling rate of 22.50 kHz, which yields 6.038 seconds. Opening that same file with Sound Recorder shows that it is 6.12 seconds in length. Does that help?


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups