forked from sin365/AxibugEmuOnline
优化音频流数据不够时的数据设置
This commit is contained in:
parent
65978580be
commit
1fd27d7fb7
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace MyNes.Core
|
namespace MyNes.Core
|
||||||
{
|
{
|
||||||
|
@ -167,8 +167,8 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ac8cd27a180bf3e489b2ca27c821bffe, type: 3}
|
m_Script: {fileID: 11500000, guid: ac8cd27a180bf3e489b2ca27c821bffe, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
VideoCom: {fileID: 0}
|
VideoCom: {fileID: 730321753}
|
||||||
AudioCom: {fileID: 0}
|
AudioCom: {fileID: 1379369700}
|
||||||
--- !u!1 &455467288
|
--- !u!1 &455467288
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -34,22 +34,18 @@ namespace AxibugEmuOnline.Client
|
|||||||
m_as.Play();
|
m_as.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float lastData = 0;
|
||||||
void OnAudioFilterRead(float[] data, int channels)
|
void OnAudioFilterRead(float[] data, int channels)
|
||||||
{
|
{
|
||||||
while (_buffer.Count >= data.Length / 2)
|
|
||||||
{
|
|
||||||
//Thread.Sleep(10);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
int step = channels;
|
int step = channels;
|
||||||
for (int i = 0; i < data.Length; i += step)
|
for (int i = 0; i < data.Length; i += step)
|
||||||
{
|
{
|
||||||
var rawData = _buffer.Count > 0 ? _buffer.Dequeue() : 0;
|
var rawFloat = _buffer.Count > 0 ? (_buffer.Dequeue() / 124f) : lastData;
|
||||||
var rawFloat = rawData / 124f;
|
|
||||||
data[i] = rawFloat;
|
data[i] = rawFloat;
|
||||||
for (int fill = 1; fill < step; fill++)
|
for (int fill = 1; fill < step; fill++)
|
||||||
data[i + fill] = rawFloat;
|
data[i + fill] = rawFloat;
|
||||||
|
|
||||||
|
lastData = rawFloat;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -155,13 +155,18 @@ PlayerSettings:
|
|||||||
useHDRDisplay: 0
|
useHDRDisplay: 0
|
||||||
hdrBitDepth: 0
|
hdrBitDepth: 0
|
||||||
m_ColorGamuts: 00000000
|
m_ColorGamuts: 00000000
|
||||||
targetPixelDensity: 0
|
targetPixelDensity: 30
|
||||||
resolutionScalingMode: 0
|
resolutionScalingMode: 0
|
||||||
resetResolutionOnWindowResize: 0
|
resetResolutionOnWindowResize: 0
|
||||||
androidSupportedAspectRatio: 1
|
androidSupportedAspectRatio: 1
|
||||||
androidMaxAspectRatio: 2.1
|
androidMaxAspectRatio: 2.1
|
||||||
applicationIdentifier: {}
|
applicationIdentifier:
|
||||||
buildNumber: {}
|
Standalone: com.DefaultCompany.AxibugEmuOnline.Client
|
||||||
|
buildNumber:
|
||||||
|
Standalone: 0
|
||||||
|
VisionOS: 0
|
||||||
|
iPhone: 0
|
||||||
|
tvOS: 0
|
||||||
overrideDefaultApplicationIdentifier: 0
|
overrideDefaultApplicationIdentifier: 0
|
||||||
AndroidBundleVersionCode: 1
|
AndroidBundleVersionCode: 1
|
||||||
AndroidMinSdkVersion: 22
|
AndroidMinSdkVersion: 22
|
||||||
@ -180,12 +185,12 @@ PlayerSettings:
|
|||||||
strictShaderVariantMatching: 0
|
strictShaderVariantMatching: 0
|
||||||
VertexChannelCompressionMask: 4054
|
VertexChannelCompressionMask: 4054
|
||||||
iPhoneSdkVersion: 988
|
iPhoneSdkVersion: 988
|
||||||
iOSTargetOSVersionString:
|
iOSTargetOSVersionString: 12.0
|
||||||
tvOSSdkVersion: 0
|
tvOSSdkVersion: 0
|
||||||
tvOSRequireExtendedGameController: 0
|
tvOSRequireExtendedGameController: 0
|
||||||
tvOSTargetOSVersionString:
|
tvOSTargetOSVersionString: 12.0
|
||||||
VisionOSSdkVersion: 0
|
VisionOSSdkVersion: 0
|
||||||
VisionOSTargetOSVersionString:
|
VisionOSTargetOSVersionString: 1.0
|
||||||
uIPrerenderedIcon: 0
|
uIPrerenderedIcon: 0
|
||||||
uIRequiresPersistentWiFi: 0
|
uIRequiresPersistentWiFi: 0
|
||||||
uIRequiresFullScreen: 1
|
uIRequiresFullScreen: 1
|
||||||
@ -313,7 +318,7 @@ PlayerSettings:
|
|||||||
locationUsageDescription:
|
locationUsageDescription:
|
||||||
microphoneUsageDescription:
|
microphoneUsageDescription:
|
||||||
bluetoothUsageDescription:
|
bluetoothUsageDescription:
|
||||||
macOSTargetOSVersion:
|
macOSTargetOSVersion: 10.13.0
|
||||||
switchNMETAOverride:
|
switchNMETAOverride:
|
||||||
switchNetLibKey:
|
switchNetLibKey:
|
||||||
switchSocketMemoryPoolSize: 6144
|
switchSocketMemoryPoolSize: 6144
|
||||||
@ -563,7 +568,8 @@ PlayerSettings:
|
|||||||
scriptingDefineSymbols: {}
|
scriptingDefineSymbols: {}
|
||||||
additionalCompilerArguments: {}
|
additionalCompilerArguments: {}
|
||||||
platformArchitecture: {}
|
platformArchitecture: {}
|
||||||
scriptingBackend: {}
|
scriptingBackend:
|
||||||
|
Standalone: 1
|
||||||
il2cppCompilerConfiguration: {}
|
il2cppCompilerConfiguration: {}
|
||||||
il2cppCodeGeneration: {}
|
il2cppCodeGeneration: {}
|
||||||
managedStrippingLevel: {}
|
managedStrippingLevel: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user