Skip to content
SirusDoma edited this page Sep 11, 2018 · 9 revisions

Genode.Audio

Genode.Audio a simple yet powerful Cross-platform Audio Engine which is provides audio playbacks, recording, decoding and encoding capabilities. Written under C# language based on OpenAL (with OpenTK binding).

The initial idea of the engine is to serve a certain rhythm game project. Therefore, the engine has very low latency due to satisfy the game requirement.

In addition to low latency, the playback also utilize it's own native handle pool. This will allow the consumer to overcome sound instancing problem of OpenAL. While there's no limit of the number instantiated Sound object, OpenAL limitation still there. The engine will only able to handle 256 of playing SoundChannel simultaneously.

Refer to following Documentation to get started, from a simple playback to extending your own streaming implementation:

Getting Started

  1. Initialization
  2. Creating and Playing Sound
  3. SoundSystem Update Housing
  4. Recording Audio
  5. Clean up

Extending Audio Engine

It is possible to extend audio engine by implementing your own SoundStream, the best scenario is to support additional audio format that weren't supported by the engine or implement VoIP.

This documentation still not yet cover this topic, however here's general idea to extend engine capabilities:

  1. You can implement SoundReader and / or SoundWriter to implement your own audio decoder and audio encoder respectively, this will allow you to read format that wasn't recognized by the engine.
  2. It also possible to extend SoundRecorder<T> to record with different destination than Sound object. You will have to supply type parameter of T to define where the recorded audio stored. This is useful for VoIP as you can write the recorded audio data directly to network stream without saving it to memory or disk.
  3. Lastly, you can implement SoundStream to support audio format that not supproted by the engine, or streaming from different source (e.g: stream audio from network)

Those mentioned class are abstract classes, there's few method you have to implement. For SoundReader, SoundWriter and SoundRecorder, you will need to register their type to SoundProcessorFactory class.

For more information, refer to XML documentation of the codes.