WebRTCでやれよ!と言われそうなところですが、 WebSocket+WebAudioの組み合わせで音声ストリーミングをシンプルに構成する方法を紹介してみます。
サーバーサイドは何でも良いのですが、
とりあえずNode.jsでtest.mp3
というサンプルファイルをpcmモジュールでデコードし、
wsでクライアントに垂れ流す作りにしておきます。
// Made with Amplify Shader Editor | |
// Available at the Unity Asset Store - http://u3d.as/y3X | |
Shader "3D/OU3DScreen" | |
{ | |
Properties | |
{ | |
[HideInInspector] __dirty( "", Int ) = 1 | |
_MainTex("MainTex", 2D) = "white" {} | |
[Toggle]_ToggleSwitch2("Toggle Switch2", Float) = 0 | |
} |
English => https://gist.github.com/tateisu/c3c13f2580961e86f79889a17f57260a
$ apk add --no-cache curl
$ echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab
$ cat > /etc/cgconfig.conf <<EOF
mount {
cpuacct = /cgroup/cpuacct;
memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;