Skip to content

Instantly share code, notes, and snippets.

View lantos1618's full-sized avatar
🐙
yeet

Lantos lantos1618

🐙
yeet
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
// #include <opus/opus.h>
#include </opt/homebrew/Cellar/opus/1.5.2/include/opus/opus.h> // cbf build path
// brew install opus
// gcc -O3 -o miniaudio_opus_example miniaudio_opus_example.c -I/opt/homebrew/Cellar/opus/1.5.2/include -L/opt/homebrew/Cellar/opus/1.5.2/lib -lm -lpthread -lopus && ./miniaudio_opus_example
#define MINIAUDIO_IMPLEMENTATION
#include "miniaudio.h"
import AVFoundation
import Opus
import SwiftUI
import Starscream
import CoreAudio
import CoreAudioTypes
import AVFoundation
import AudioToolbox
import Foundation
use std::future::Future;
use std::thread::sleep;
use std::time::Duration;
use anyhow::{anyhow, Result};
use opus::{Application, Decoder, Encoder};
use rodio::buffer;
use rodio::cpal;
use rodio::cpal::traits::HostTrait;
use rodio::cpal::traits::StreamTrait;
@lantos1618
lantos1618 / index.html
Created May 7, 2024 08:39
http2_duplexing typescript nodejs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
import { remote } from 'webdriverio';
async function main() {
const caps = {
"platformName": "Android",
"appium:automationName": "UiAutomator2",
"appium:ensureWebviewsHavePages": true,
"appium:nativeWebScreenshot": true,
"appium:newCommandTimeout": 3600,
"appium:connectHardwareKeyboard": true,
import AVFoundation
import Opus
import SwiftUI
import Starscream
import CoreAudio
import CoreAudioTypes
import AVFoundation
import AudioToolbox
import Foundation
use std::future::Future;
use std::thread::sleep;
use std::time::Duration;
use anyhow::{anyhow, Result};
use rodio::buffer;
use rodio::cpal;
use rodio::cpal::traits::HostTrait;
use rodio::cpal::traits::StreamTrait;
use rodio::source::SineWave;
use std::future::Future;
use anyhow::Ok;
use tokio::sync::mpsc;
use tokio::sync::oneshot;
use tokio::task;
use tokio::task::JoinSet;
use anyhow::Result;
enum Signal {
use tokio::net::{TcpListener, TcpStream};
use tokio_stream::StreamExt;
use tokio_tungstenite::{accept_async, WebSocketStream};
use opus::{Decoder, Encoder, Error};
use rodio::{OutputStream, Source};
use rodio::buffer::SamplesBuffer;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let listener = TcpListener::bind("0.0.0.0:8080").await?;
use std::time::Duration;
use anyhow::{anyhow, Ok, Result};
use rodio::{
cpal::{
self,
traits::{HostTrait, StreamTrait},
BufferSize, SampleRate, StreamConfig,
},