Is there a way to generate sounds programmatically (w/o sound file)?

Generate tones, etc. in code? Is there a way? Regards, Patrick

Replies

I don't know if that's what you're looking for, but you can call directly a sound reference, such as:

    AudioServicesPlayAlertSound(SystemSoundID(1322))

You have to try (on device only, not simulator).

  • 1016: bip bip
  • 1057: tweet
  • 1322: bong bong

Hope that helps

The Building a Signal Generator sample code project shows how to generate audio signals in the context of AVAudioEngine. The sample code project is associated with WWDC 2019 session 510: What’s New in AVAudioEngine.

Thanks for the suggestions!