LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
Macros | Functions
sound.h File Reference

Go to the source code of this file.

Macros

#define XENON_TONE_AMPLITUDE_100   12000
 
#define XENON_TONE_AMPLITUDE_50   6000
 
#define XENON_TONE_AMPLITUDE_25   3000
 
#define xenon_post_beep()   xenon_tone(950, 250, XENON_TONE_AMPLITUDE_50)
 

Functions

void xenon_sound_init (void)
 
void xenon_sound_submit (void *data, int len)
 
int xenon_sound_get_free (void)
 
int xenon_sound_get_unplayed (void)
 
void xenon_tone (uint32_t frequency, uint32_t duration, int16_t amplitude)
 

Macro Definition Documentation

◆ xenon_post_beep

#define xenon_post_beep ( )    xenon_tone(950, 250, XENON_TONE_AMPLITUDE_50)

Does the classic POST beep that old computers do (950hz tone, 250ms)

Definition at line 50 of file sound.h.

◆ XENON_TONE_AMPLITUDE_100

#define XENON_TONE_AMPLITUDE_100   12000

Definition at line 43 of file sound.h.

◆ XENON_TONE_AMPLITUDE_25

#define XENON_TONE_AMPLITUDE_25   3000

Definition at line 45 of file sound.h.

◆ XENON_TONE_AMPLITUDE_50

#define XENON_TONE_AMPLITUDE_50   6000

Definition at line 44 of file sound.h.

Function Documentation

◆ xenon_sound_get_free()

int xenon_sound_get_free ( void  )
Returns
Available free buffer space in bytes.

Definition at line 93 of file sound.c.

◆ xenon_sound_get_unplayed()

int xenon_sound_get_unplayed ( void  )
Returns
Unplayed queued data size in bytes.

Definition at line 111 of file sound.c.

◆ xenon_sound_init()

void xenon_sound_init ( void  )

Initialize DAC, de-assert AUD_CLAMP, initialize HDMI audio

Definition at line 16 of file sound.c.

◆ xenon_sound_submit()

void xenon_sound_submit ( void *  data,
int  len 
)

Submit PCM audio data to be played on the conencted TV, monitor, audio device

48kHz sample rate Signed 16-bit stereo PCM, little endian

Parameters
dataPointer to buffer of audio data
lenNumber of bytes from the buffer to submit

Definition at line 69 of file sound.c.

◆ xenon_tone()

void xenon_tone ( uint32_t  frequency,
uint32_t  duration,
int16_t  amplitude 
)

Generare a square wave tone

Parameters
frequencyTone frequency
durationTone length in milliseconds.
amplitudePeak sample amplitude (signed 16-bit).

Definition at line 128 of file sound.c.