1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-22 05:03:22 +00:00
CC-Tweaked/doc
Jonathan Coates b048b6666d
Add arbitrary audio support to speakers (#982)
Speakers can now play arbitrary PCM audio, sampled at 48kHz and with a
resolution of 8 bits. Programs can build up buffers of audio locally,
play it using `speaker.playAudio`, where it is encoded to DFPWM, sent
across the network, decoded, and played on the client.

`speaker.playAudio` may return false when a chunk of audio has been
submitted but not yet sent to the client. In this case, the program
should wait for a speaker_audio_empty event and try again, repeating
until it works.

While the API is a little odd, this gives us fantastic flexibility (we
can play arbitrary streams of audio) while still being resilient in the
presence of server lag (either TPS or on the computer thread).

Some other notes:
 - There is a significant buffer on both the client and server, which
   means that sound take several seconds to finish after playing has
   started. One can force it to be stopped playing with the new
  `speaker.stop` call.

 - This also adds a `cc.audio.dfpwm` module, which allows encoding and
   decoding DFPWM1a audio files.

 - I spent so long writing the documentation for this. Who knows if it'll
   be helpful!
2021-12-13 22:56:59 +00:00
..
events Add arbitrary audio support to speakers (#982) 2021-12-13 22:56:59 +00:00
guides Add arbitrary audio support to speakers (#982) 2021-12-13 22:56:59 +00:00
images Some doc updates 2021-08-13 22:35:08 +01:00
stub Add the rest of the feature introduction versions to the docs (#908) 2021-08-26 08:02:58 +01:00
head.html Update illuaminate again 2020-12-28 18:20:13 +00:00
index.md Move repo to cc-tweaked org 2021-10-17 18:14:32 +01:00
logo.png Optimise CC:T logo 2021-09-26 10:26:42 +01:00