Skip to content

Instantly share code, notes, and snippets.

@bitingsock
bitingsock / audio-dupe.lua
Last active April 11, 2024 20:45
Runs a child process to play a second audio stream. Synced through named pipe. Recommend using with [cycle-adevice](https://gist.github.com/bitingsock/ad58ee5da560ecb922fa4a867ac0ecfd) to change the output device of the parent process.
--New child with start with the current 'aid' and 'audio-device' of the parent
-- non-Windows environments require the use of the 'socat' package
local platform_is_windows = (package.config:sub(1, 1) == "\\")
local options = require 'mp.options'
local o = {
pipe_template = platform_is_windows and "\\\\.\\pipe\\mpvDupedAudio" or "~/mpvDupedAudio", --windows format
new_child_key = 'Ctrl+A', --Start a new child: 'Ctrl+Shift+a'
cycle_child_control_key = 'Ctrl+Alt+A', --Cycle child control: 'Ctrl+Shift+Alt+a'
cycle_child_aid_key = 'Ctrl+Alt+a', --Cycle 'aid' of child: 'Ctrl+Alt+a'
child_increase_volume_key = 'Ctrl+Alt+WHEEL_UP', --Change volume of child: 'Ctrl+Alt+wheel'

Sony Bravia HTTP API

The sony bravia has a HTTP API interacted with using a Pre-Shared key. There's a more complex auth flow but I've not described it here.

There wasn't any documentation, so I've written some. If you're a TV integrator don't read this, you'll laugh. I'm probably just getting confused by UPnP.

Disclaimer: I've only tested this on my TV, which is a KDL-50W829B. Your TV might not have all of the services; see Available services section for how to discover what your TV supports.

@elerch
elerch / NodeFromCSharp.cs
Last active September 9, 2023 13:43
Using C# to host and communicate with node.js This proof of concept launches node.exe as a separate process, redirecting stdin/stdout. It simply calculates 2+2, then sends a process.exit() call after 10 seconds so the (.Net) app can complete (the suppressOut just gets node to output "undefined" instead of the full return value of setTimeout). Da…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
@danielfaust
danielfaust / samsung_remote.py
Created May 30, 2011 04:12
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung