[FFmpeg-soc] BFI

Mike Melanson mike at multimedia.cx
Sat Mar 22 19:43:47 CET 2008


Sisir Koppaka wrote:
> I have a question regarding the PCM frequency.
> The PCM wiki page says :
> 
> frequency = 1000000 / (256 - frequency_divisor)
> 
> A common divisor is 211 which yields an integer frequency of 22222 Hz, a
> common rate in the days of the Sound Blaster. Note that while very low
> frequencies (all the way down to 3921 Hz) were supported, frequencies above
> 45454 Hz were not.Does this mean
> 
> Does this mean that I have to hardcode the frequency_divisor as 211? Right
> now, I'm doing this:
> sample_rate = 1000000/(256 - get_byte(pb))
> 
> where the get_byte() fetches the first byte of the PCM bytestream in the
> file. I saw that this was done in one of the codecs, so I took it to mean
> that the first byte contained the frequency_divisor. Maybe that inference is
> wrong?

Oh wow, this is wrong in, like, 9 different ways. :) The colloquial 
phrase here is, "too smart by half". Maybe I gave you too much 
information to work with.

The PCM page mentions that weird formula, yes. But it only applies to 
specs that store Sound Blaster frequency divisors (see VOC and C93 as 
examples). The BFI spec does not say that it stores a Sound Blaster 
frequency divisor. Here's what the BFI spec says:

  bytes 828-831  (+33C) audio sample rate

Open 2287.bfi in a hex editor. Travel to offset 0x33C. What 4 bytes live 
there?

-- 
	-Mike Melanson



More information about the FFmpeg-soc mailing list