目标是读取蓝牙LE心率监测器的值.
使用谷歌的样本,我明白了
private void scanLeDevice(final boolean enable) {
if (enable) {
// Stops scanning after a pre-defined scan period.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mScanning = false;
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
}, SCAN_PERIOD);
mScanning = true;
mBluetoothAdapter.startLeScan(mLeScanCallback);
} else {
mScanning = false;
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
}
Run Code Online (Sandbox Code Playgroud)
导致mBluetoothAdapter.stopLeScan显示为已弃用.但是Startscan不是方法mBluetoothAdapter.
如何更改它以使其与当前API一起使用?
我有一个带有相当接近的片段的 file.txt
file 'input.mp4'
inpoint 1.5402465510368346
outpoint 2.722609395980835
file 'input.mp4'
inpoint 3.192511146068573
outpoint 7.074568028450012
file 'input.mp4'
inpoint 7.851800565719604
outpoint 9.023683423995971
file 'input.mp4'
inpoint 10.054571752548219
outpoint 12.008032734394073
file 'input.mp4'
inpoint 18.70977670431137
outpoint 21.20993923664093
file 'input.mp4'
inpoint 24.51183382153511
outpoint 26.465287650823594
...
Run Code Online (Sandbox Code Playgroud)
我把它们连接起来
ffmpeg -safe 0 -f concat -i file.txt out.mp4
Run Code Online (Sandbox Code Playgroud)
我试过
ffmpeg -use_wallclock_as_timestamps 1 -safe 0 -f concat -i file.txt out.mp4
Run Code Online (Sandbox Code Playgroud)
然而我得到
[mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 2069, current: 2067; changing to 2070. This may result in …Run Code Online (Sandbox Code Playgroud) 我正在使用此命令列出可用的声音
private static SpeechSynthesizer sprecher;
...
sprecher = new SpeechSynthesizer();
...
private static List<VoiceInfo> GetInstalledVoices()
{
var listOfVoiceInfo = from voice
in sprecher.GetInstalledVoices()
select voice.VoiceInfo;
return listOfVoiceInfo.ToList<VoiceInfo>();
}
Run Code Online (Sandbox Code Playgroud)
我只有4种不同的声音(Hedda,Hazel,David和Zira),但Windows本身显示了更多扬声器。
因此,我仅收到“ -Desktop”语音。如何通过c#访问其他扬声器?