Skip to content

Instantly share code, notes, and snippets.

Fix WontFix


Fix WontFix
View GitHub Profile
zed / ping_pong.c
Last active Jun 25, 2022
Native messaging "ping_pong" example in C
View ping_pong.c
/*** Native messaging "ping_pong" example in C.
* It is reimplementation of the corresponding Python example from
* # Python 3.x version
* # Read a message from stdin and decode it.
* def getMessage():
* rawLength =
* if len(rawLength) == 0:
littledan /
Last active Jun 29, 2022
Anonymous inline modules

Note: this document is subsumed by the module blocks proposal

Anonymous inline modules

Anonymous inline modules are syntax for the contents of a module, which can then be imported.

let inlineModule = module {
  export let y = 1;
UCIS / gist:845eda1755d38eddfc3f0f99268c27da
Created Jun 17, 2020
Opus/WebM player in JavaScript
View gist:845eda1755d38eddfc3f0f99268c27da
function OpusWebmPacker() {
var channels = 2;
var sample_rate = 48000;
var position = 0;
var packets = [];
var buffer = new Uint8Array(4 + 1275);
var buffer_offset = 0;
function Concat() {
View gist:983f2c16d36aee7f75cff4ac477d6805
class WebmPacketizer : IPacketizer {
private UInt64 position = 0;
static WebmPacketizer () {
public WebmPacketizer() {
private static Byte[] Concat(params Byte[][] parts) {
View gist:c52757fef62239d502806f53b6700a58
class OggPacketizer : IPacketizer {
static UInt32[] checksumTable;
static UInt32 serial_counter = 1;
uint pageIndex = 0;
uint serial;
UInt64 position = 0;
static OggPacketizer() {
varqox /
Last active May 20, 2022
How to record multiple applications and microphone into one audio file on Linux using PulseAudio

How to record multiple applications and microphone into one audio file on Linux

Step 0. Terminology

Sinks are for output, sources are for input. To stream source to sink a loopback must be created. More shall you find there.

Step 1. Create output sink that will be recorded

Our output sink will be named recording.

pacmd load-module module-null-sink sink_name=recording sink_properties=device.description=recording
bagder / http3.php
Last active Aug 10, 2022
View http3.php
if (!defined('CURL_HTTP_VERSION_3')) {
define('CURL_HTTP_VERSION_3', 30);
$ch = curl_init("");
spvkgn /
Last active Oct 12, 2021
Script to build a statically linked opus-tools
# ==============================================================
# Script to build a statically linked version of opus-tools
# Release tarballs:
amishshah /
Last active Mar 18, 2022
A guide to the Ogg container format for demuxing opus audio

You take a stream/buffer of binary data. The start of your data is a "Page", which has a header followed by data.


You need to read the following data from the header (see for more detail)

  • capture_pattern - bytes 0 to 3, must read OggS
  • stream_structure_version - byte 4, must be 0
  • header_type_flag - byte 5, a bitflag that tells you metadata about the page (is it a new packet? is a packet continued here? is it the first/last page of the stream?)
  • absolute granule position - bytes 6 to 13, not needed unless you want seeking
  • stream serial number - bytes 14 to 17, a serial number given to each stream contained in the Ogg file. This is important for playing Ogg files that contain other streams, such as video or cover art. You need to identify and only bother parsing the Opus stream.
Jozo132 / float32encoding.js
Last active Aug 16, 2022
JavaScript (Node.js) IEEE 754 Single precision Floating-Point (32-bit) binary conversion from and to both Hex and Bin
View float32encoding.js
/* ##### float32encoding.js #####
MIT License
- Forked 'toFloat' from
- Forked 'toHex' from stackoverflow answer
- Modifyed by: Jozo132 (
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including