audio device button icons
This commit is contained in:
1 parent
ace8ed6ec7
commit
2fbd5820f2
14 files changed
+325
-5068
No files matched your search
Binary file not shown.
@@ -0,0 +1,98 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e83df78eea4cff48a1d7dc83dd66313
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,98 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3528fb2a0a0ee634d92af0370b0a3f1c
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -469,7 +469,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -512, y: 0}
|
||||
m_AnchoredPosition: {x: -256, y: 0}
|
||||
m_SizeDelta: {x: 64, y: 64}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!222 &529626900707344084
|
||||
@@ -627,7 +627,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
@@ -1862,7 +1862,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -128, y: 0}
|
||||
m_AnchoredPosition: {x: -192, y: 0}
|
||||
m_SizeDelta: {x: 64, y: 64}
|
||||
m_Pivot: {x: 1, y: 1}
|
||||
--- !u!222 &1813467189418542979
|
||||
@@ -1886,7 +1886,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
@@ -1949,7 +1949,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Texture: {fileID: 2800000, guid: 2172509423aef564cbffe0df01411020, type: 3}
|
||||
m_Texture: {fileID: 2800000, guid: 3528fb2a0a0ee634d92af0370b0a3f1c, type: 3}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
@@ -1980,13 +1980,15 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 66a6b9c6a6e18884ebeb1bf742e3be4d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
CaptureType: 0
|
||||
CaptureType: 1
|
||||
SpectrumSize: 128
|
||||
MinFrequency: 100
|
||||
MaxFrequency: 20000
|
||||
ScalingStrategy: 2
|
||||
Filters: []
|
||||
preferences: {fileID: 8681115429733332136}
|
||||
speakerTexture: {fileID: 2800000, guid: 3528fb2a0a0ee634d92af0370b0a3f1c, type: 3}
|
||||
micTexture: {fileID: 2800000, guid: 7e83df78eea4cff48a1d7dc83dd66313, type: 3}
|
||||
--- !u!1 &6466943970290633308
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2132,7 +2134,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66c49f8afa3aafa4a8ae7ccc181b7632
|
||||
VisualEffectImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +1,8 @@
|
||||
using Assets.WasapiAudio.Scripts.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
[ExecuteAlways]
|
||||
public class AudioSource : MonoBehaviour {
|
||||
public WasapiCaptureType CaptureType = WasapiCaptureType.Loopback;
|
||||
public int SpectrumSize = 32;
|
||||
@@ -11,6 +12,8 @@ public class AudioSource : MonoBehaviour {
|
||||
public WasapiAudioFilter[] Filters;
|
||||
|
||||
public Preferences preferences;
|
||||
public Texture speakerTexture;
|
||||
public Texture micTexture;
|
||||
|
||||
private WasapiAudio _wasapiAudio;
|
||||
private float[] _spectrumData;
|
||||
@@ -20,16 +23,18 @@ public class AudioSource : MonoBehaviour {
|
||||
? WasapiCaptureType.Loopback
|
||||
: WasapiCaptureType.Microphone;
|
||||
|
||||
Debug.Log($"Pref: {preferences.data.useLoopback} {CaptureType}");
|
||||
// Debug.Log($"Pref: {preferences.data.useLoopback} {CaptureType}");
|
||||
|
||||
Initialise();
|
||||
}
|
||||
|
||||
void Initialise() {
|
||||
bool isLoopback = CaptureType == WasapiCaptureType.Loopback;
|
||||
SetImageTexture(isLoopback);
|
||||
|
||||
_wasapiAudio?.StopListen();
|
||||
|
||||
_wasapiAudio = new WasapiAudio(CaptureType, SpectrumSize, ScalingStrategy, MinFrequency, MaxFrequency, Filters, spectrumData =>
|
||||
{
|
||||
_wasapiAudio = new WasapiAudio(CaptureType, SpectrumSize, ScalingStrategy, MinFrequency, MaxFrequency, Filters, spectrumData => {
|
||||
_spectrumData = spectrumData;
|
||||
});
|
||||
|
||||
@@ -45,15 +50,26 @@ public class AudioSource : MonoBehaviour {
|
||||
}
|
||||
|
||||
public void ToggleCaptureType() {
|
||||
if (CaptureType == WasapiCaptureType.Loopback) {
|
||||
bool isLoopback = CaptureType == WasapiCaptureType.Loopback;
|
||||
if (isLoopback) {
|
||||
CaptureType = WasapiCaptureType.Microphone;
|
||||
preferences.SetUseLoopback(false);
|
||||
} else {
|
||||
CaptureType = WasapiCaptureType.Loopback;
|
||||
preferences.SetUseLoopback(true);
|
||||
}
|
||||
|
||||
Initialise();
|
||||
}
|
||||
|
||||
void SetImageTexture(bool useLoopback) {
|
||||
RawImage image = GetComponent<RawImage>();
|
||||
|
||||
if (!image) return;
|
||||
|
||||
image.texture = useLoopback
|
||||
? speakerTexture
|
||||
: micTexture;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class AudioSourceButton : MonoBehaviour {
|
||||
public Texture speakerTexture;
|
||||
public Texture micTexture;
|
||||
|
||||
void SetTexture(bool useLoopback) {
|
||||
RawImage image = GetComponent<RawImage>();
|
||||
|
||||
if (!image) return;
|
||||
|
||||
image.texture = useLoopback
|
||||
? speakerTexture
|
||||
: micTexture;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fcc1666cf0d29224bb3e82588be4dc4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user