Changeset 32703 in project


Ignore:
Timestamp:
08/16/15 21:40:04 (5 years ago)
Author:
felix winkelmann
Message:

updated openal + alut wiki pages

Location:
wiki/eggref/4
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/openal

    r30756 r32703  
    55
    66This extension provides bindings for the [[http://www.openal.org|OpenAL]] sound API, version 1.1.
     7
     8See [[alut]] for a binding for ALUT, a utility library for OpenAL.
    79
    810''Currently this has only been tested on Mac OS X with the
     
    176178<procedure>(alc:SuspendContext C-POINTER)</procedure>
    177179
    178 === alut
    179 
    180 Usage: {{(require-extension alut)}}
    181 
    182 <procedure>(alut:Exit)</procedure>
    183 <procedure>(alut:Init INT C-POINTER)</procedure>
    184 <procedure>(alut:LoadWAVFile STRING) -> INT C-POINTER INT INT BOOL</procedure>
    185 <procedure>(alut:LoadWAVMemory C-POINTER) -> INT C-POINTER INT INT BOOL</procedure>
    186 <procedure>(alut:UnloadWAV INT C-POINTER INT INT)</procedure>
    187 
    188180=== openal
    189181
     
    206198Returns a buffer identifier.
    207199
    208 <procedure>(openal:load-buffer FILENAME)</procedure>
    209 
    210 Loads sound data in WAV format from {{FILENAME}} and returns a buffer identifier.
    211200
    212201=== Examples
    213 
    214 <enscript highlight=scheme>
    215  (use openal)
    216  (require-extension al)
    217  (require-extension alc)
    218 
    219  ;; this code does no error checking
    220 
    221  (define device (alc:OpenDevice #f))
    222  (define context (alc:CreateContext device #f))
    223 
    224  (alc:MakeContextCurrent context)
    225 
    226  (define buf (openal:load-buffer "example.wav"))
    227  (define source (openal:make-source buf))
    228 
    229  (al:Sourcei source al:LOOPING 1)
    230  (al:SourcePlay source)
    231  (read-line)
    232  (alc:MakeContextCurrent #f)
    233  (alc:DestroyContext context)
    234  (alc:CloseDevice device)
    235 </enscript>
    236202
    237203Generating a triangle wave:
    238204<enscript highlight=scheme>
    239 (use openal)
    240 (use al)
    241 (use alc)
    242 (use srfi-4)
     205(use openal al alc srfi-4 extras)
    243206
    244207(define device (alc:OpenDevice #f))
     
    257220(define buffer (openal:make-buffer data #f 44100))
    258221(define source (openal:make-source buffer))
    259 
    260222(al:Sourcei source al:LOOPING 1)
    261223(al:SourcePlay source)
     
    266228</enscript>
    267229
     230
     231
    268232=== Author
    269233
     
    272236=== License
    273237
    274  Copyright (c) 2006-2010, Felix L. Winkelmann
     238 Copyright (c) 2006-2015, Felix L. Winkelmann
    275239 All rights reserved.
    276240 
     
    297261== Version History
    298262
     263; 0.9 : moved {{alut}} stuff into a separate egg ([[alut]])
    299264; 0.7 : test runs only for limited time when invoked over chicken-install
    300265; 0.6 : fixed missing libraries for non-Mac platforms
Note: See TracChangeset for help on using the changeset viewer.