picciano / iOS-Tone-Generator

Tone Generator for iOS
47 stars 15 forks source link

do you know why I can't access _channels from swift? #5

Closed cmario92 closed 8 years ago

cmario92 commented 8 years ago

I have imported the TGSineWaveToneGenerator.h/.m and Xcode automatically bridge the Objective-C files into my swift project. I have create a new instance ' var generator = TGSineWaveToneGenerator(channels: 2)', but it is not possible to set the frequency, such as generator.channels = xx.

picciano commented 8 years ago

Sorry, it's been quite a while since I've looked at this project...

You could either just change the default frequency in the header file if you need a constant frequency, or you could create another init method that takes both the number of channels and frequency. You could even pass in different frequencies for each channel that way.

cmario92 commented 8 years ago

I used one of your custom constructors to set up the frequency and amplitude, thanks a lot for your rapid reply:)