Skip to content

Instantly share code, notes, and snippets.

View yoshitaka-xvi's full-sized avatar

Hirotoshi Yoshitaka yoshitaka-xvi

View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleLoopback : MonoBehaviour {
public string[] DeviceNames = new string[2];
public int prepareBufferSize = 1024;
AudioSource source;
AudioClip[] microphoneClips = new AudioClip[2];
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
[RequireComponent(typeof(AudioSource))]
public class LoopbackMicrophone : MonoBehaviour {
public int prepareBufferSize = 1024;
AudioClip clip;
@yoshitaka-xvi
yoshitaka-xvi / MicrophoneRecorder.cs
Created January 29, 2018 08:26
MicrophoneクラスでAudioClipを使わずに録音するサンプル
using System;
using UnityEngine;
// 1. WAVWriter: https://github.com/TyounanMOTI/WAVWriter
// Releasesから.unitypackageをダウンロードしてインポートしてください
// 2. 空のGameObjectにアタッチして開始すると、プロジェクトのルートフォルダに record.wav を書き出します。
// 録音するマイクは、Windowsであれば既定のマイクです。
public class MicrophoneRecorder : MonoBehaviour {
AudioClip clip;
int head = 0;
import tensorflow as tf
import argparse
import sys
from collections import deque
import pyaudio
# pylint: disable=unused-import
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
# pylint: enable=unused-import
@yoshitaka-xvi
yoshitaka-xvi / ProjectionMatrixSetter.cs
Created September 5, 2017 04:20
Unity 2017.2.0b10で、Immersiveヘッドセット向け描画でNearClipとFarClipを変更するためのUnityコンポーネント
using UnityEngine;
public class ProjectionMatrixSetter : MonoBehaviour {
Camera main;
[SerializeField]
float nearClip = 0.01f;
[SerializeField]
float farClip = 500.0f;