Skip to content

Clafted/AudioTracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔊 AudioTracer: 2D Audio Ray-Tracer | Made in Raylib

AudioTDemo.-.Made.with.Clipchamp.mp4

Table of Contents

Use-Case 🌍

As AudioTracer simulates sound propagation, it is fit for the analysis of room acoustics. Software such as Odeon A/S' ODEON Room Acoustics Software and Virtual Acoustic's RAVEN leverage simulation to measure the aural qualities of building interiors.

Inspiration 💭

I have always thought of implementing ray-tracing, but never got to it until now. I feel like the visual aspect of Computer Generated things has already been thoroughly developed over the years, and it would be nice for a change of perspective. Instead of implementing light ray-tracing, then, I chose to implement sound ray-tracing instead, to explore new grounds, and eventually apply a little bit of knowledge from our light ray-tracer friends.

Controls 🎮

(Best tested with headphones 🎧)

  • Move Cursor: Moves player (the green one)
  • SPACE/B Keys: Play sound
  • UP/DOWN Keys: In/Decrease sample-size (# rays)
  • RIGHT/LEFT Keys: In/Decrease max number of bounces
  • Q/E Keys: In/Decrease resolution

Development Progress ☑️

Material-based rendering

Having a working prototype, I hope to further improve the performance, possibly by some code refactoring or rethinking some algorithms. A bit more ambitious of a goal, however, is to support the use of different materials; akin to light ray-tracing--in which different materials absorb varying levels of light and result in different colours--I want to support different materials cause the sound to be absorbed and result in various effects.

Solutions

Supporting materials: In addition to positional data, LineObjects (the white lines) include material properties which influence how much sound reflects, refracts, or is absorbed.

  • 16/10/2025 Currently all lines have the same material, as the engine only stores positional data, not yet material data

2D Sound

Currently, AudioTracer renders positional sound on a single axis ("1D audio"), left-to-right. This leaves potential for the addition of front-to-back positional audio, i.e. hearing things in front of or behind you. The Raylib library (on which this project is built) abstracts the Miniaudio library which it uses for audio support. This causes an issue in accessing the 3D audio features from Miniaudio.

Solutions

Panning techniques: Raylib has a 3D-positional audio program example in the audio examples page, which utilizes a recipe of volume and panning configurations to simulate 3D audio. Thus I hope to replicate this technique to acheive 2D audio.

Useful resources

About

A 2D Audio Ray-Tracer. Sounds cool doesn't it?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published