[英]AudioKit - Trying to generate sound in Audio Kit 5
I am setting up a start application that on start up, will generate some white noise using AudioKit.我正在设置一个启动应用程序,它在启动时会使用 AudioKit 产生一些白噪声。
I have set up the following code that gets called on start up of my application:我已经设置了以下在我的应用程序启动时调用的代码:
let engine = AudioEngine()
let noise = WhiteNoise()
let mixer = Mixer(noise)
mixer.volume = 1
engine.output = mixer
try! engine.start()
But when I start up the application I do not hear any sound being generated.但是当我启动应用程序时,我听不到任何声音。 I set up a simple example to generate a sine wave using AVFoundation and I was able to hear the sound generated from my simulator.
我设置了一个简单的示例来使用 AVFoundation 生成正弦波,并且我能够听到模拟器生成的声音。
I found an old thread - AudioKit - no sound output but I checked the AudioKit repo and it looks like this feature was removed a couple months back since it was not being used.我发现了一个旧线程 - AudioKit - 没有声音 output但我检查了 AudioKit 存储库,看起来这个功能几个月前被删除了,因为它没有被使用。
Any help would be appreciated!任何帮助,将不胜感激!
Try noise.start()
Generators don't default to being on.试试
noise.start()
生成器不会默认开启。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.