Skip to content

Instantly share code, notes, and snippets.

View Brendonovich's full-sized avatar

Brendan Allan Brendonovich

View GitHub Profile
#!/usr/bin/env node
import fs from "node:fs/promises";
import nPath from "node:path";
const projectPath = process.argv[2];
const contentDir = nPath.join(projectPath, "content");
const segmentsDir = nPath.join(contentDir, "segments");
const exists = (path) =>
use ffmpeg::{
codec as avcodec,
format::{self as avformat},
};
use std::path::Path;
// F32 sample buffer with AUDIO_FORMAT
// Always packed/interlaced
pub struct AudioSampleBuffer {
samples: Vec<f32>,
@Brendonovich
Brendonovich / main.swift
Created January 20, 2025 14:11
Camera recording with swift
// I want this to be frame-by-frame in future
import Cocoa
import PlaygroundSupport
import AVFoundation
class WebcamRecorder: NSObject, AVCaptureFileOutputRecordingDelegate {
private var captureSession: AVCaptureSession?
private var videoOutput: AVCaptureMovieFileOutput?
@Brendonovich
Brendonovich / main.rs
Last active January 20, 2025 17:38
Frame-by-frame h264 decoding with AVAssetReader
// the equivalent in rust via cidre
use std::time::Instant;
use cidre::{av, ns};
const PATH: &str = r#"./assets/display.mp4"#;
#[tokio::main]
async fn main() {
let asset = av::UrlAsset::with_url(&ns::Url::with_fs_path_str(PATH, false), None).unwrap();
@Brendonovich
Brendonovich / CLA.md
Created January 17, 2024 05:12
MacroGraph CLA

Contributor License Agreement

We are incredibly thankful for contributions we receive from the community. We require our external contributors to sign a Contributor License Agreement ("CLA") in order to ensure that our projects remain licensed under Free and Open Source licenses such as AGPLv3 or Apache 2 allowing MacroGraph Technologies to build a sustainable business.

MacroGraph Technologies is committed to having a true Free and Open Source Software ("FOSS") license for our non-commercial software. A

This file has been truncated, but you can view the full file.
{"version":3,"mappings":";;;;;;;;GASa,IAAIA,GAAE,OAAO,IAAI,eAAe,EAAEC,GAAE,OAAO,IAAI,cAAc,EAAEC,GAAE,OAAO,IAAI,gBAAgB,EAAEC,GAAE,OAAO,IAAI,mBAAmB,EAAEC,GAAE,OAAO,IAAI,gBAAgB,EAAEC,GAAE,OAAO,IAAI,gBAAgB,EAAEC,GAAE,OAAO,IAAI,eAAe,EAAEC,GAAE,OAAO,IAAI,mBAAmB,EAAEC,GAAE,OAAO,IAAI,gBAAgB,EAAEC,GAAE,OAAO,IAAI,YAAY,EAAEC,GAAE,OAAO,IAAI,YAAY,EAAEC,GAAE,OAAO,SAAS,SAASC,GAAEC,EAAE,CAAC,OAAUA,IAAP,MAAqB,OAAOA,GAAlB,SAA2B,MAAKA,EAAEF,IAAGE,EAAEF,EAAC,GAAGE,EAAE,YAAY,EAAqB,OAAOA,GAApB,WAAsBA,EAAE,KAAI,CAC1e,IAAIC,GAAE,CAAC,UAAU,UAAU,CAAC,MAAM,EAAE,EAAE,mBAAmB,UAAU,GAAG,oBAAoB,UAAU,GAAG,gBAAgB,UAAU,EAAE,EAAEC,GAAE,OAAO,OAAOC,GAAE,GAAG,SAASC,GAAEJ,EAAEK,EAAEC,EAAE,CAAC,KAAK,MAAMN,EAAE,KAAK,QAAQK,EAAE,KAAK,KAAKF,GAAE,KAAK,QAAQG,GAAGL,EAAC,CAACG,GAAE,UAAU,iBAAiB,GACnQA,GAAE,UAAU,SAAS,SAASJ,EAAEK,EAAE,CAAC,GAAc,OAAOL,GAAlB,UAAkC,OAAOA,GAApB,YAA6BA,GAAN,KAAQ,MAAM,MAAM,uHAAuH,EAAE,KAAK,QAAQ,gBAAgB,KAAKA,EAAEK,EAAE,UAAU,CAAC,EAAED,GAAE,UAAU,YAAY,SAASJ,EAAE,CAAC,KAAK,QAAQ,mBAAmB,KAAKA,EAAE,aAAa,CAAC,EAAE,SAASO,IAAG,EAAEA,GAAE,UAAU
"use strict";
const https = require("https");
const querystring = require("querystring");
const aws4 = require("aws4");
class PollyTTS {
constructor(credentials) {
this.credentials = credentials;
}