In a loop:
[code:i7y1u09q]uint posMs = 0;
uint posBit = 0;
uint diffBits = 0;
uint difTime = 0;
uint bitRate = 0;
pChannel.getPosition(ref posMs, FMOD.TIMEUNIT.MS);
if (count_bitrateCycles > 8)
pChannel.getPosition(ref posBit, FMOD.TIMEUNIT.RAWBYTES);
diffBits = posBit - position_lastPCMbytes; difTime = posMs - position_lastMs; bitRate = diffBits / difTime * 8; position_lastPCMbytes = posBit; position_lastMs = posMs; count_bitrateCycles = 0;
if (player_state != PlayerState.play)
position_lastPCMbytes = 0;
position_lastMs = 0;
count_bitrateCycles = 0;
Testing with an mp3 file of 192kbps CBR this varies between 170 and 192kbps. The idea is to get the results periodically like does winamp.
Why not shows 192kbps fixed?
I tried taking the sample RAWBYTES before the TIMEUNIT.MS and still equal.
Please login first to submit.