Skip to content

Instantly share code, notes, and snippets.

/*
A Minimal Capture Program
This program opens an audio interface for capture, configures it for
stereo, 16 bit, 44.1kHz, interleaved conventional read/write
access. Then its reads a chunk of random data from it, and exits. It
isn't meant to be a real program.
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html
@PeadarO
PeadarO / gist:38814aa14169d4e73dfb2a50acea5418
Created May 5, 2021 07:07 — forked from enile8/gist:2424514
A small example program using SQLite with C++
// A small example program using SQLite with C++
#include <iostream>
#include <sqlite3.h>
using namespace std;
static int callback(void *NotUsed, int argc, char **argv, char **azColName)
{
int i;
for(i=0; i<argc; i++)
{
// ffmpeg_console.cpp : Defines the entry point for the console application.
// Change from doc\examples\avcodec.c
//
#include "stdafx.h"
#include <stdio.h>
#include <stdio.h>
#include <math.h>
extern "C"{
#ifndef __STDC_CONSTANT_MACROS
@PeadarO
PeadarO / nat-traversal.js
Created November 2, 2020 09:36 — forked from metal3d/nat-traversal.js
NAT Traversal with node (0.5.x)
/*
NAT traversal system to let 2 computers behind firewall to communicate.
Example:
Client A (your machine) has public ip 1.1.1.1
Client B (distant machine) has public ip 2.2.2.2
You want to bind port 5556 on your machine
Distant Client want to bind port 5557
#include <string>
#include "Recorder.hpp"
namespace {
/**
* 処理に失敗していたら例外を投げる
* @param message エラーメッセージ
* @param result 処理の結果
* @throws runtime_error 処理が失敗していた時
*/