OpenAL
Contents |
Introduction
OpenAL is a cross-platform 3D audio library, it is used mainly in audio applications & games. i.e ut2004 & TaSpring. Unfortunaly OpenAL defaults to OSS for sound playback if its not configured & told to use something else i.e ALSA.
Which config file to use
There are 2 different places for the config file for OpenAL
- /etc/openalrc is for system wide setup
- ~/.openalrc is for user specific setup
Configuring OpenAL
To comment lines # = text ; = options
| Code: Select audio system to use |
(define devices '(alsa)) (define devices '(alsa esd arts sdl null)) |
- First line is just tellin OpenAL to use alsa
- Second line tells OpenAL to use alsa, if that fails it falls back to esd and so on.
- OpenAL uses ESPEAKER environment var (should be set to HOST[:PORT]) to determine esd server to connect to.
| Code: Select soundcard for ALSA to use |
# Sound Output (define alsa-out-device default) (define alsa-out-device "hw:0,0") # Sound Input i.e microphone (define alsa-in-device default) (define alsa-in-device "hw:0,0") |
- If u only have one soundcard use the first line(s). It tells openal to use default soundcard for output | input.
- Second Line(s) specifc tell OpenAL which soundcard to use. i.e u got more than one soundcard
- ( Use aplay -l for find out soundcard numbers i.e hw0:0 )
| Code: Speaker Setup |
# 2 Speaker setup (define speaker-num 2) # 4 Speaker surround with ALSA (define speaker-num 4) (define alsa-out-device "surround40:0,0") # 6 Speaker surround with ALSA (define speaker-num 6) (define alsa-out-device "surround51:0,0") |
- Note that the alsa-out-device line is different if using surrond sound setup than shown previously
| Code: More options |
(define display-banner #t) (define source-gain 1.0) (define sampling-rate 44800) |
These options are also avaible according to the source code.
Example
Below is example of /etc/openalrc. Its setup to use Alsa & default soundcard & 2 speakers
| File: /etc/openalrc |
(define devices '(alsa)) (define alsa-out-device default) (define alsa-in-device default) (define speaker-num 2) |
Last modified: Fri, 05 Sep 2008 12:44:00 +1000 Hits: 4,906
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and list their apartments, townhouses and units.
