我正在尝试使用 Google Publisher API 对我的 Android 应用程序的订阅进行后端升级/降级操作。
我在 Alpha 通道中发布了该应用程序,并让一些测试人员进行“测试”购买。在生成订阅的同一天,一切看起来都很好。我可以使用购买令牌查看有效数据,调用方法:
Purchases.Subscriptions.Get
Run Code Online (Sandbox Code Playgroud)
我的问题是,当“测试”订阅自动续订(第二天)时,看起来购买令牌不再可用,当我调用该方法时:
Purchases.Subscriptions.Get
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
购买令牌与包名称不匹配。[400]
看起来当“测试”订阅自动续订时,购买令牌也会发生变化。
我发现很难找到一种方法将使用 OpenTk.NetStandard 捕获的音频存储到 NetCore C# 中正确的 .WAV 文件中。
我正在寻找一种在 Raspberry pi 上运行时有效的解决方案,因此 NAudio 或任何 Windows 特定方法都无法解决我的问题。
我发现了其他几个 SO 答案,它们展示了如何使用 opentk 捕获音频,但没有介绍如何将其存储在 wav 文件中。
这是代码的摘录,该代码应该从我从另一个问题中获取的麦克风中读取数据,我看到 AudioCapture 类是:
const byte SampleToByte = 2;
short[] _buffer = new short[512];
int _sampling_rate = 16000;
double _buffer_length_ms = 5000;
var _recorders = AudioCapture.AvailableDevices;
int buffer_length_samples = (int)((double)_buffer_length_ms * _sampling_rate * 0.001 / BlittableValueType.StrideOf(_buffer));
using (var audioCapture = new AudioCapture(_recorders.First(), _sampling_rate, ALFormat.Mono16, buffer_length_samples))
{
audioCapture.Start();
int available_samples = audioCapture.AvailableSamples;
_buffer = new short[MathHelper.NextPowerOfTwo((int)(available_samples * SampleToByte / …Run Code Online (Sandbox Code Playgroud)