gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > Buffer lengths?

#77726 - RavenWorks - Sun Apr 02, 2006 6:01 pm

Just out of curiosity... I'm following Deku's VBL-interrupt sound guide, and I'm not sure how he's coming up with the values for the buffer lengths... For a frequency of 42048 it's recommended to use a buffer 704 samples long... while this seems to work fine, why is it 704 and not (42048 / 60) = 700.8, thus 701 samples or so? Are the extra three samples just dropped, doesn't that affect the audio? Or (much more likely) am I misunderstanding what's going on?

Thanks for satisfying my curiosity! ;)

#77729 - tepples - Sun Apr 02, 2006 7:10 pm

RavenWorks wrote:
For a frequency of 42048 it's recommended to use a buffer 704 samples long... while this seems to work fine, why is it 704 and not (42048 / 60) = 700.8, thus 701 samples or so?

Because the GBA does not run at 60.0 frames per second. It runs at one frame per 280896 CPU cycles, which is about 59.73 frames per second.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#79367 - Ant6n - Thu Apr 13, 2006 5:50 am

...how do you know this exact number? Where did you find the specs for that?
...do you have more interesting durations of things that happen in the machine in - terms of clock cycles?

thx
anton

#79411 - tepples - Thu Apr 13, 2006 1:18 pm

GBATEK tells all
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.