{"action":"created","issue":{"url":"https://api.github.com/repos/tumtumtum/StreamingKit/issues/241","labels_url":"https://api.github.com/repos/tumtumtum/StreamingKit/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/tumtumtum/StreamingKit/issues/241/comments","events_url":"https://api.github.com/repos/tumtumtum/StreamingKit/issues/241/events","html_url":"https://github.com/tumtumtum/StreamingKit/issues/241","id":120733868,"number":241,"title":"Why the totoal duration Of MP3 is more than the right duration?","user":{"login":"gilnuy","id":4455464,"avatar_url":"https://avatars.githubusercontent.com/u/4455464?v=3","gravatar_id":"","url":"https://api.github.com/users/gilnuy","html_url":"https://github.com/gilnuy","followers_url":"https://api.github.com/users/gilnuy/followers","following_url":"https://api.github.com/users/gilnuy/following{/other_user}","gists_url":"https://api.github.com/users/gilnuy/gists{/gist_id}","starred_url":"https://api.github.com/users/gilnuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilnuy/subscriptions","organizations_url":"https://api.github.com/users/gilnuy/orgs","repos_url":"https://api.github.com/users/gilnuy/repos","events_url":"https://api.github.com/users/gilnuy/events{/privacy}","received_events_url":"https://api.github.com/users/gilnuy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-07T09:37:05Z","updated_at":"2015-12-07T12:45:56Z","closed_at":null,"body":"for example:\r\nthe duration is 1:30:10 \r\nstreammingkit return is 1:30:40.\r\n\r\nhow could i get the right duration?\r\nplease help me,thank you!"},"comment":{"url":"https://api.github.com/repos/tumtumtum/StreamingKit/issues/comments/162515616","html_url":"https://github.com/tumtumtum/StreamingKit/issues/241#issuecomment-162515616","issue_url":"https://api.github.com/repos/tumtumtum/StreamingKit/issues/241","id":162515616,"user":{"login":"yincheng1988","id":8380468,"avatar_url":"https://avatars.githubusercontent.com/u/8380468?v=3","gravatar_id":"","url":"https://api.github.com/users/yincheng1988","html_url":"https://github.com/yincheng1988","followers_url":"https://api.github.com/users/yincheng1988/followers","following_url":"https://api.github.com/users/yincheng1988/following{/other_user}","gists_url":"https://api.github.com/users/yincheng1988/gists{/gist_id}","starred_url":"https://api.github.com/users/yincheng1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yincheng1988/subscriptions","organizations_url":"https://api.github.com/users/yincheng1988/orgs","repos_url":"https://api.github.com/users/yincheng1988/repos","events_url":"https://api.github.com/users/yincheng1988/events{/privacy}","received_events_url":"https://api.github.com/users/yincheng1988/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T12:45:56Z","updated_at":"2015-12-07T12:45:56Z","body":"I've modified like this, and it does work well.\r\n```\r\n-(double) calculatedBitRate\r\n{\r\n    double retval;\r\n    \r\n    if (packetDuration > 0.0)\r\n\t{\r\n\t\tif (processedPacketsCount > STK_BIT_RATE_ESTIMATION_MIN_PACKETS_PREFERRED || (audioStreamBasicDescription.mBytesPerFrame == 0 && processedPacketsCount > STK_BIT_RATE_ESTIMATION_MIN_PACKETS_MIN))\r\n\t\t{\r\n\t\t\tdouble averagePacketByteSize = (processedPacketsSizeTotal * 1.0) / processedPacketsCount;\r\n\t\t\t\r\n\t\t\tretval = averagePacketByteSize / packetDuration * 8;\r\n\t\t\t\r\n\t\t\treturn retval;\r\n\t\t}\r\n\t}\r\n\t\r\n    retval = (audioStreamBasicDescription.mBytesPerFrame * audioStreamBasicDescription.mSampleRate) * 8;\r\n    \r\n    return retval;\r\n}\r\n```\r\n\r\n"}}