L14_sound - GameBoy Advance Programming Sound Sound Basics...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
GameBoy Advance Programming Sound
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sound Basics
Background image of page 2
The Digital Process A / D Fs D / A Sound pressure fluctuations Sound pressure fluctuations Analog voltage Digital voltage Sampling frequency Sampled signal Analog voltage
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
GBA Sound Four legacy sound effect channels We won't use these Dual digital channels Direct Sound A Direct Sound B Each has an 8-bit digital-to-analog converters (DACs) Play any sounds you want Well, at least within the capabilities of 8 bit sound
Background image of page 4
Sound Step by Step
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Getting the Sound Obtain an 8-bit .wav file Convert to .bin using wav2gba.exe wav2gba <input.wav> <output.bin> Convert .bin to .c using bin2c.exe bin2c <input.bin> <output.c> Add the c file to your project Will be unsigned chars. .. Don't forget to extern it in your main file
Background image of page 6
Sound Devices are Sensitive Sensitive Sound Device (DAC etc.) FIFO QUEUE FIFO QUEUE FIFO QUEUE FIFO QUEUE TIMER We tell the sound device to play a sample each time the timer times out.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Calculating Timer Timing Set up a timer to send samples from FIFO to the sound chip at the right frequency Bit 10: Sound A sampling rate Timer Bit 14: Sound B sampling rate Timer 0 or 1 in each bit for Timer 0 or 1 Figure out clock cycles per sample 2^24 / soundSamplingRate = cycles / sample Set up a timer to overflow after that many cycles Initialize timer to value of 65536 – (# of cycles)
Background image of page 8
Example At 16.7 MHz, the CPU has exactly 16777216 (2^24) cycles per second To get the number of cycles per sample, divide 16777216 by the sampling rate. Suppose you want to play back a sample at one
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/23/2011 for the course COMPUTER S 1372 taught by Professor Smith,david during the Spring '11 term at Georgia Institute of Technology.

Page1 / 37

L14_sound - GameBoy Advance Programming Sound Sound Basics...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online