小编Elt*_*Lin的帖子

为什么不管延迟的值如何调用 audioplayer.play(atTime: delay) 都不发出声音

预计:

当 audioplayer.play(atTime: 1) 被调用时,计时器重置为 0,并且在第一秒播放音频播放器

现实:

我尝试了 delay = 0.000000001, 1, 100000000,但无论如何,都不会播放噪音。然而,代码被清楚地执行了(因为“函数被调用”出现在控制台中)

为什么会出现差异?

C = AVAudioPlayer() // assume other setups are done
C.play(atTime: 1)
print("function was called")
Run Code Online (Sandbox Code Playgroud)

delay avaudioplayer swift xcode8

1
推荐指数
1
解决办法
852
查看次数

How to record mic WHILE video calling with Daily.co on iOS Safari

Problem

With my iPad's iOS Safari, I can use Daily.co's video API to call other devices. But the moment I start recording my local microphone via the audio-recorder-polyfill library , everybody else will no longer be able to hear me, even though I can still hear them and share my camera. Even when the recording session ends, the audio call remains broken (though the audio-recorder works successfully).

It seems iOS specific, because I have no problems with my Surface's Windows …

mobile-safari audio-streaming video-conferencing web-mediarecorder webrtc-ios

1
推荐指数
1
解决办法
59
查看次数

为什么将 DispatchQueue 延迟函数放在另一个 DispatchQueue 中在 Swift 中不起作用

预期行为:

对于 i = 0,打印语句在 0 秒后调用。

对于 i = 1,1.1 秒后调用打印语句

对于 i = 2,打印语句在 2.2 秒后调用

实际行为:

分别在 0、1、2、3 秒后调用打印语句,即忽略内部延迟函数。

那么为什么会出现差异呢?

    for i in 0...3 {

        DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(i), execute: {  

            DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(i/10), execute: {
                print("function was called")
            })      
        })
    }
Run Code Online (Sandbox Code Playgroud)

loops delay delayed-execution swift3 xcode8

0
推荐指数
1
解决办法
3782
查看次数