Sunday, March 19, 2023
HomeiOS developmentios - AudioKit: Programmatically choose waveform for oscillator

ios – AudioKit: Programmatically choose waveform for oscillator

I created an oscillator with AudioKit resp. SoundpipeAudioKit and I might wish to let the consumer change the waveform at runtime. I am simply displaying the related elements:

let osc = DynamicOscillator(amplitude: 0) 

The chosen waveform comes from a GroupBox that comprises a number of waveforms in an HStack. I wager this isn’t related, I am simply studying the chosen waveform right into a string, like this:

.onTapGesture {
    waveForm = waveForms[index]

Someway AudioKit is utilizing an enum for the waveforms. Tips on how to take the string worth to assign as an enum?

This doesn’t work:


It returns

No precise matches in name to initator

That is the definition of “Desk”:

public class Desk: MutableCollection {

And this are the Enums:

/// Supported default desk sorts
public enum TableType {
    /// Normal sine waveform
    case sine



Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments