This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DissonanceMicPermission | |
: MonoBehaviour | |
{ | |
void OnEnable() | |
{ | |
StartCoroutine(RequestPermission()); | |
} | |
IEnumerator CheckPermission() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TenkokuWetness | |
: BaseExternalWetnessSource | |
{ | |
[SerializeField, Range(-1, 1), Tooltip("Current change-per-second in environmental wetness")] | |
private float _editorRainIntensity; | |
public override float RainIntensity | |
{ | |
get | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using UnityEngine; | |
class GetAecMetrics | |
: MonoBehaviour | |
{ | |
#if UNITY_IOS && !UNITY_EDITOR | |
private const string ImportString = "__Internal"; | |
private const CallingConvention Convention = default(CallingConvention); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Dissonance.VAD; | |
// Create a class to receive the event callbacks | |
class LogVoiceActivationListener | |
: IVoiceActivationListener | |
{ | |
void VoiceActivationStart() | |
{ | |
Debug.Log("Started Talking"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
namespace Assets | |
{ | |
public class TestMic | |
: MonoBehaviour | |
{ | |
// Set an explicit input device here. leave as null to use the default. | |
public string MicName = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Dissonance.Audio | |
{ | |
/// <summary> | |
/// Helper methods to convert between various representations of an audio signal | |
/// </summary> | |
internal static class FormatConverter | |
{ | |
#region 16 bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=:read_string_to_parse_to_number o=0 n=1 goto(i=="")*18+(i!="")*2 // Input, setup, check for empty string | |
a=i---i goto(a=="1")*2+(a=="2")*3+(a=="3")*4+(a=="4")*5+(a=="5")*6+4 // Consume 1 character of input, jump to characters [12345], fall through due to runtime error is string is empty | |
:result=o goto 20 // SUCCESS, result is stored in `o` | |
goto(a=="6")*6+(a=="7")*7+(a=="8")*8+(a=="9")*9+(a=="0")*10+5 // Jump to characters [67890], jump to next line for unknown char | |
goto 19 // FAILURE, unknown char (stored in `a`) | |
o+=1*n n*=10 goto 2 | |
o+=2*n n*=10 goto 2 | |
o+=3*n n*=10 goto 2 | |
o+=4*n n*=10 goto 2 | |
o+=5*n n*=10 goto 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using NAudio.Wave; | |
using UnityEngine; | |
namespace Dissonance.Audio.Capture | |
{ | |
public class BasicFileStreamingCapture | |
: MonoBehaviour, IMicrophoneCapture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using NAudio.Wave; | |
using UnityEngine; | |
namespace Dissonance.Audio.Capture | |
{ | |
public class BasicFileStreamingCapture | |
: MonoBehaviour, IMicrophoneCapture | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using NAudio.Wave; | |
using UnityEngine; | |
namespace Dissonance.Audio.Capture | |
{ | |
public class SomeNamespace | |
: MonoBehaviour, IMicrophoneCapture | |
{ |
NewerOlder