Skip to content

Instantly share code, notes, and snippets.

@Hiradur
Hiradur / ambisonics_setup_guide_for_games.md
Last active February 20, 2024 17:52
Guide for achieving speaker-based immersive (3D) audio in hundreds of PC games using OpenAL Soft and Ambisonics

Speaker-based immersive (3D) audio in hundreds of PC games via Ambisonics using OpenAL Soft

Introduction

It's possible to achieve speaker-based immersive (3D) audio in many PC games that don't seem to be supported by current proprietary object-based audio technologies using some tinkering and a technology called Ambisonics. Since Ambisonics seems to have gone largely unnoticed in the consumer-space so far, I will first explain what it is, what its benefits are, what content is available right now, and how to set it up on a PC for gaming.

Theoretical Background

What is Ambisonics?

Many should be familiar with multi-channel audio based on discrete speaker feeds or the more recent object-based audio. Ambisonics uses neither of these approaches. Instead, it describes a continous full-sphere sound field around a single point in space. A so called Ambisonics decoder uses this information in combination with a decoding matrix, which is specific to a given speaker layout, to reproduce this sound field a

@Hiradur
Hiradur / setup_ambisonics_on_gpu.sh
Last active May 29, 2022 17:12
Guide for setting up an Ambisonics playback system on GNU/Linux using consumer equipment such as a GPU and an AV-receiver
#!/bin/sh
# Setting up an Ambisonics listening rig using consumer hardware
# This guide was tested on Ubuntu Linux using an Nvidia GPU, a consumer-grade 5.1 av-receiver and audio transmission via HDMI.
# install necessary software
sudo apt install qjackctl ambdec mpv
# launch Qjackctl and start JACK on a sound card that is not the GPU
qjackctl
@Hiradur
Hiradur / adwaita_dark_everywhere_stylus.css
Created May 29, 2022 11:08
Color theme for the Stylus browser addon using colors from the Adwaita Dark theme
@-moz-document url-prefix("file://"), regexp("https?:\\/\\/(?!(www\\.)?(computerbase?!(\\/forum)|docs\\.google|forum\\.xda-developers|github|startpage|steamcommunity|userstyles|youtube)\\..*).*") {
/*
* Global Adwaita-dark Stylus theme
* This theme applies a color scheme similar to Adwaita-dark to every webpage
* This theme is based on Solarized Dark Everywhere by thedude (CC0 licensed):
* https://userstyles.org/styles/98305/solarized-dark-everywhere
* which in turn was based on Midnight Surfing Alternative by luckymouse (CC0 licensed)
* https://userstyles.org/styles/47391/midnight-surfing-alternative
*
* Author of this theme: Hiradur
@Hiradur
Hiradur / toggle_theme_gtk_qt.sh
Last active May 29, 2022 10:49
Shell script to toggle between light and dark theme for GTK and QT applications
#!/bin/sh
# toggle_theme_gtk_qt.sh
# Original author: Hiradur
# License: CC0
# This script toggles between light and dark theme for GTK and QT applications
if [ $(gsettings get org.gnome.desktop.interface gtk-theme) = "'Adwaita-dark'" ]; then
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita"
@Hiradur
Hiradur / toggle_av_setups.sh
Last active May 29, 2022 11:01
Shell script to toggle video and audio output between two setups (different displays and audio systems) using X.org and Pulseaudio
#!/bin/sh
# toggle_av_setups.sh
# Original author: Hiradur
# License: CC0
# This script toggles video and audio output between two setups:
# 1. monitor with stereo speakers on desk
# 2. TV with 5.1 surround sound
# only one of these screens is enabled at a given time
@Hiradur
Hiradur / toggle_stereo_surround.sh
Last active May 29, 2022 10:55
Shell script to toggle Pulseaudio output profile between stereo and surround sound on the same audio device
#!/bin/sh
# toggle_stereo_surround.sh
# Original author: Hiradur
# License: CC0
# This script toggles between stereo and surround output.
# It is useful e.g. if you your AVR only provides matrix-decoding of surround
# sound for stereo sources.
# The sink name might need to be changed based on what `pacmd stat` lists as
@Hiradur
Hiradur / theme_toggle.sh
Created November 6, 2016 13:16
Shell script to toggle between Solarized Light/Dark theme in various applications
#!/bin/sh
# theme_toggle.sh
# Original author: Hiradur
# License: CC0
# Description: Toggle between two themes for various applications
# designed for the Solarized themes by Ethan Schoonover
# This script toggles between a light and a dark theme for various applications
# by replacing the corresponding option(s) in their config files
@Hiradur
Hiradur / folder_enc.sh
Created November 6, 2016 13:15
Script which converts all flac files inside a folder to mp3, ogg vorbis or opus and puts them in another directory, maintaining the artist/album directory path scheme
#!/bin/sh
set -eu
# folder_enc.sh
# Original author: Hiradur
# License: CC0
# Description: Converts all flac files in a given folder to mp3, vorbis or opus
# files and put them in a different directory while maintaining the artist/album
# folder structure.
@Hiradur
Hiradur / Solarized Light Everywhere
Last active January 14, 2017 10:50
Userstyle for the Firefox addon Stylish which enables Solarized Light for every webpage (modification of Solarized Dark Everywhere by thedude, licensed under CC0)
/* Solarized Light Theme for every webpage for the Stylish addon for Firefox */
/* Adopted from the Solarized Dark Everywhere theme by thedude: https://userstyles.org/styles/98305/solarized-dark-everywhere */
/* AGENT_SHEET */
@-moz-document url-prefix(http://), url-prefix(https://), url-prefix(ftp://), url-prefix(file://), url(about:blank),
/* Best effort to exclude about pages that conflict with Australis-native styling */
regexp("about:(?!addons|app-manager|config|customizing|stylish-edit|downloads|permissions|preferences|sync-tabs|webrtc).*")
/*url-prefix("about:neterror")*/
@Hiradur
Hiradur / q3config.cfg
Last active February 29, 2016 09:21
OpenArena config optimized for Raspberry Pi: maximum fps without compromising usability
// generated by quake, do not modify
unbindall
bind TAB "+scores"
bind ENTER "+button2"
bind ESCAPE "togglemenu"
bind SPACE "+moveup"
bind + "sizeup"
bind - "sizedown"
bind / "weapnext"
bind 0 "weapon 10"