Skip to content

Instantly share code, notes, and snippets.

View glaurent's full-sized avatar

Guillaume Laurent glaurent

View GitHub Profile
@glaurent
glaurent / ListCoreAudioDevices.swift
Last active July 11, 2023 07:50 — forked from robotconscience/SelectAudioOutput.mm
List CoreAudio devices in Swift
import Foundation
import CoreAudio
var propertyAddress = AudioObjectPropertyAddress(mSelector: kAudioHardwarePropertyDevices, mScope: kAudioObjectPropertyScopeGlobal, mElement: kAudioObjectPropertyElementMaster)
var propertySize:UInt32 = 0
if AudioObjectGetPropertyDataSize(AudioObjectID(kAudioObjectSystemObject), &propertyAddress, 0, nil, &propertySize) == noErr {
let numDevices = Int(propertySize) / MemoryLayout<AudioDeviceID>.size
@glaurent
glaurent / gist:aad82c4185f3c92f21dc
Created December 11, 2014 22:10
adding a video in a SceneKit scene using a SpriteKit SKVideoNode
let spriteKitScene = SKScene(size: CGSize(width: 1276.0 / 2.0, height: 712.0 / 2.0))
var videoSpriteKitNode:SKVideoNode?
let videoNode = SCNNode()
videoNode.geometry = SCNPlane(width: videoNodeWidth, height: videoNodeHeight)
// using SpriteKit scene with videonode inside
//
spriteKitScene.scaleMode = .AspectFit