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.

Beginners > please i need a help in sound?

#6678 - ken - Sun Jun 01, 2003 9:19 pm

i have three quastion:

1- can i play more than one format of sound file in the same game
(for ex. : .mod & .pcm or .pcm & .midi ..........etc.)

2- what is the most recommended sound file format to use in the GBA
( easy to use with high quality)

3- dose the GBA supports midi,
(built in support).

thanks

#6711 - tepples - Mon Jun 02, 2003 4:30 am

ken wrote:
1- can i play more than one format of sound file in the same game (for ex. : .mod & .pcm or .pcm & .midi ..........etc.)

If your engine supports it, you can mix multiple sample formats. I write my mixer so that it mixes to a 16-bit buffer, adding in one sample on each pass. Then I truncate to 8 bits when reformatting it as a .

Steps to writing a music engine:
1. Learn how to play just one PCM sound at a time.
2. Learn how to play a sound generated in real time, e.g. a sine wave at arbitrary frequency.
3. Write a mixer.
4. Learn how to play tones on the tone generators that the GBA inherits from the GBC.
5. Write a parser for your favorite music file format. See the specifications on Wotsit's Format.

Quote:
2- what is the most recommended sound file format to use in the GBA
( easy to use with high quality)

8-bit PCM with the sign bit flipped, at sample rates in the neighborhood of 21 kHz or below.

Quote:
3- dose the GBA supports midi

Probably not, unless there's some BIOS function that remains undocumented. You'll have to write your own MIDI file interpreter and your own mixer.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.