Skip to content

Instantly share code, notes, and snippets.

View martindevans's full-sized avatar

Martin Evans martindevans

View GitHub Profile
using System;
using NAudio.Wave;
using UnityEngine;
namespace SomeNamespace
{
public class BasicFileStreamingCapture
: MonoBehaviour, IMicrophoneCapture
{
public bool IsRecording { get; private set; }
public class Test
: MonoBehaviour
{
void OnEnable()
{
try
{
DissonanceComms.TestDependencies()
}
catch (Exception e)

Note: This was written as a response for a specific Dissonance customer who had applied some tweaks:

  • This is written assuming Tiny Frames (i.e. 10ms), these can only be used in a LAN setting.
  • Jitter buffer delay in Dissonance is normally a minimum of 50ms, that's not taken into account here.

All delays here are worst case, the average case will be about half that!



public class Cat
: IEquatable<Cat>
{
public readonly string Name;
public readonly int Age;
public Cat(string name, int age)
{
Name = name;
Age = age;
public class Demo
{
public static void DemoIt()
{
var cat = new GenericBuilder<TypeFalse, TypeFalse>()
.SetAge(11)
.SetName("Totoro")
.Build();
}
}
public class Demo
{
public static void DemoIt()
{
var builder = new GenericBuilder<TypeTrue, TypeFalse>();
// builder.Build(); Not valid
var builder2 = new GenericBuilder<TypeTrue, TypeTrue>();
builder2.Build();
}
static class ArrExt
{
public static T[] Clone<T>(this T[] arr)
{
var clone = new T[arr.Length];
for (var i = 0; i < arr.Length; i++)
clone[i] = arr[i];
return clone;
Verifying my Blockstack ID is secured with the address 15d47pR8fKugUxNk8U5LgvMW3N9iyyVoBb https://explorer.blockstack.org/address/15d47pR8fKugUxNk8U5LgvMW3N9iyyVoBb
// ==UserScript==
// @name No more mobile links
// @namespace http://tampermonkey.net/
// @version 0.2
// @description replace mobile links with non mobile links (e.g. en.m.wikipedia with en.wikipedia)
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
#!/bin/bash
IP='google.co.uk'
STATUS_FILE="/home/martin/SpeakingAssistant/state/netstate"
LOG_FILE="/home/martin/SpeakingAssistant/state/netstate.log"
if [ -r $STATUS_FILE ]; then
STATUS=`cat $STATUS_FILE`
else
STATUS="unknown"
fi