WebRTCでやれよ!と言われそうなところですが、 WebSocket+WebAudioの組み合わせで音声ストリーミングをシンプルに構成する方法を紹介してみます。
サーバーサイドは何でも良いのですが、
とりあえずNode.jsでtest.mp3
というサンプルファイルをpcmモジュールでデコードし、
wsでクライアントに垂れ流す作りにしておきます。
WebRTC スタックについて
作: | @voluntas |
---|---|
バージョン: | 0.0.3 |
url: | https://voluntas.github.io/ |
def Process.gsub pat, sub | |
mem = File.open('/proc/self/mem', 'r+') | |
maps = File.open('/proc/self/maps') | |
maps.each do |map| | |
from, to, perms, offset = map.scan(/(\h+)-(\h+) (\S+) (\h+)/)[0] | |
if perms['rw'] | |
from, to = [from, to].map { |addr| addr.hex + offset.hex } | |
data = mem.tap { |m| m.seek from }.read(to - from) rescue next |
Get Git log in JSON format
git log --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},'
The only information that aren't fetched are:
%B
: raw body (unwrapped subject and body)%GG
: raw verification message from GPG for a signed commit更新: | 2022-03-18 |
---|---|
作者: | @voluntas |
バージョン: | 2022.1 |
URL: | http://voluntas.github.io/ |
更新: | 2024-05-20 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
/***************************************************************************** | |
* directsound.c: DirectSound audio output plugin for VLC | |
***************************************************************************** | |
* Copyright (C) 2001-2009 VLC authors and VideoLAN | |
* $Id: 2f5b9f46d3739e513d875b950eaf4d2df641f9dc $ | |
* | |
* Authors: Gildas Bazin <[email protected]> | |
* | |
* This program is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU Lesser General Public License as published by |
* 平行光源の光の強さは、光源の方向のみに依存するので、各頂点の明るさは、法線 n と、光源の方向 l の内積(の関数)になります。 | |
* 反射光の光の強さは、ライトベクトルと視線への反射ベクトルのハーフベクトルと面法線の内積で計算します。 | |
* 環境光は計算量が多いので、単に色を乗せるだけで済ませます。 | |
※ライトベクトルおよび視線の反射ベクトルは、モデルの回転に対する逆行列を掛けることで正しく表示されます。 | |
ライトが固定して、ポリゴンが回る=ポリゴンを固定して、ライトを逆方向に回す | |
``` | |
<script id="vs" type="x-shader/x-vertex"> | |
attribute vec3 position; // 頂点属性:頂点座標位置 |
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections.Generic; | |
public class UILineRenderer : Graphic | |
{ | |
[SerializeField] Texture m_Texture; | |
[SerializeField] Rect m_UVRect = new Rect(0f, 0f, 1f, 1f); |
日時: | 2024-02-01 |
---|---|
作: | 時雨堂 |
資料 バージョン: | 2024.1 |
GitHub URL: | https://github.com/shiguredo/momo |
製品 URL: | https://momo.shiguredo.jp/ |