all-is-cubes icon indicating copy to clipboard operation
all-is-cubes copied to clipboard

Sound

Open kpreid opened this issue 3 years ago • 2 comments

There is only one critical requirement for sound:

  • [ ] Add a platform-independent mechanism for world and UI elements to “emit” sound (as a sequence of events), which the desktop and web code can then feed into some API.

But then there are further tasks and open questions to add sound to the game:

  • [ ] Decide how we are going to handle specific sounds, such as UI interactions and tool uses, in the all-is-cubes crate, minimizing bloat. Minimal set of recorded "click" noises? Pure synthesis? No concrete sound in the library, dependents must add their own?
  • [ ] Ambient sound synthesis (wind noise, rustles, hums, etc.) driven by character environment in the same way as camera exposure is.
  • [ ] Can we usefully synthesize sounds from block definitions? My predecessor project “Cubes” did that, but not well, but I know more about synthesis principles and techniques now. But it would probably still require material-properties hints to be not too incongruous.
  • [ ] Perhaps a Universe should be able to contain recordings for custom SFX and background music.

kpreid avatar Oct 17 '22 15:10 kpreid

As of commit fde29b0d9e43cb64963efaf3630b8bee6088d5d5 there is very minimal sound support, intended to be just enough to be able to add further features incrementally. Actual sound output is desktop only, not web.

kpreid avatar Nov 24 '22 05:11 kpreid

One of the libraries I had my eye on was web-audio-api. I just took a second look at exactly what it says it does, and it does not provide a “direct” adapter to the real Web Audio API in browsers. But, assuming it does what it says well, that still means I can plan to use the Web Audio API paradigm (audio samples and tone generators passing through a series of filters, mixers, etc.) when planning out the audio synthesis and processing that All is Cubes’ world model will assume is available.

kpreid avatar Sep 25 '24 22:09 kpreid