Skip to content

Audio 3D

App: apps/audio_3d/

Demonstrates 3D audio: a listener you move with A/D and a sound source that moves on a sine path. Space plays the sound at the source’s current position.

Terminal window
% ./plume3d audio_3d

or

Terminal window
% ./../plume3d .
  • Listener position is updated from keyboard: A left, D right (Audio.setPosition, Audio.setOrientation).
  • One source moves along X with Math.sin(_time); another (music) can be played with M.
  • Space — play the click at the moving source position.
  • GUI shows listener X and control hints.
  • AudionewSource, play, stop, setPosition, setOrientation.
  • SourcesetPosition, setLooping.
  • Inputkey, keyJustPressed.
  • Mathsin.

Same as Audio Basic: sounds/click.wav, sounds/music.wav.