#include <types.h>#include <broadway.h>Go to the source code of this file.
Enumerations | |
| enum | ai_sample_rate_t { AI_SAMPLE_RATE_48000 = 0, AI_SAMPLE_RATE_32000 } |
Functions | |
| int | ai_initialize (void) |
| Initialize the AI subsystem. | |
| int | ai_shutdown (void) |
| Shut down the AI subsystem. | |
| void | ai_set_sample_rate (ai_sample_rate_t rate) |
| Set the sample rate. | |
| ai_sample_rate_t | ai_get_sample_rate (void) |
| Get the sample rate. | |
| void | ai_enable_irq (int on_sample, int(*exec)(u32 irq, void *data), void *data) |
| Enable the sample-reached IRQ. | |
| void | ai_disable_irq (void) |
| Disable the sample-reached IRQ. | |
| void | ai_set_volume (u8 left, u8 right) |
| Sets the volume of the stereo output. | |
| void | ai_get_volume (u8 *left, u8 *right) |
| Gets the volume of the stereo output. | |
| u32 | ai_samples_played (void) |
| Gets how many samples have been played. | |
| void | ai_reset_sample_counter (void) |
| Resets the sample played counter. | |
| int | ai_is_playing (void) |
| Returns whether AI is playing audio or not. | |
| int | ai_play (int play) |
| Starts or stops the AI from playing audio. | |
An abstraction of the Audio Interface (AI). Controls various portions of the audio output (including volume and sample rate).
| enum ai_sample_rate_t |
| void ai_disable_irq | ( | void | ) |
Disable the sample-reached IRQ.
Turns off the IRQ that fires when the AI plays a specific sample.
| void ai_enable_irq | ( | int | on_sample, | |
| int(*)(u32 irq, void *data) | exec, | |||
| void * | data | |||
| ) |
Enable the sample-reached IRQ.
Turns on the IRQ that fires when the AI plays a specified sample.
| on_sample | the sample that the IRQ fires on. | |
| exec | the callback that is called when the IRQ fires. | |
| data | data provided to the callback when it fires. |
| ai_sample_rate_t ai_get_sample_rate | ( | void | ) |
Get the sample rate.
| void ai_get_volume | ( | u8 * | left, | |
| u8 * | right | |||
| ) |
Gets the volume of the stereo output.
| left | a pointer to which the left volume is put. NULL if you don't want the output. | |
| right | a pointer to which the right volume is put. NULL if you don't want the output. |
| int ai_initialize | ( | void | ) |
Initialize the AI subsystem.
Initializes the AI subsystem, registers the handler for the AI interrupt and performs all other required initialization tasks.
| int ai_is_playing | ( | void | ) |
Returns whether AI is playing audio or not.
| int ai_play | ( | int | play | ) |
Starts or stops the AI from playing audio.
| play | if 1 starts playing, or if 0 stops playing. |
| u32 ai_samples_played | ( | void | ) |
Gets how many samples have been played.
Gets the number of stereo samples that have been played since the counter was last reset (either by a system reset or a manual reset.)
| void ai_set_sample_rate | ( | ai_sample_rate_t | rate | ) |
Set the sample rate.
Must only be called when the AI is not playing audio.
| rate | a value from ai_sample_rate_t specifying the sample rate to use. |
| void ai_set_volume | ( | u8 | left, | |
| u8 | right | |||
| ) |
Sets the volume of the stereo output.
Sets the volume of the output sound, with the left and right speakers being changable independantly
| left | the volume on the left speaker. 0 is mute, 0xFF is maximum. | |
| right | the volume on the right speaker. 0 is mute, 0xFF is maximum. |
| int ai_shutdown | ( | void | ) |
Shut down the AI subsystem.
Shuts down the AI subsystem, unregisters the handler for the AI interrupt and performs all other required shut down tasks.
1.6.3