1

I am setting up a start application that on start up, will generate some white noise using 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.

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.

Any help would be appreciated!

dots
  • 11
  • 1

1 Answers1

1

Try noise.start() Generators don't default to being on.

Aurelius Prochazka
  • 4,510
  • 2
  • 11
  • 34
  • Not sure if I'm missing something but noise.start() did not work for me either. I tried placing it before and after the engine.start() call. – dots Apr 15 '21 at 21:55
  • not totally sure what the issue was but looked into the AudioKit Cookbook code and used the NoiseGeneratorsView() as a reference and it worked now! – dots Apr 15 '21 at 22:58