picciano / iOS-Tone-Generator

Tone Generator for iOS
47 stars 15 forks source link

Changing frequencies no longer generates pure sounds #2

Open Rumple-Phillip opened 9 years ago

Rumple-Phillip commented 9 years ago

Disregard ~ I solved it by looking at the original Cocoa Touch one; I was setting one of my frequencies far too high.

picciano commented 9 years ago

It has been a while since I’ve used that code. But I’ll take a look at it when I get some time. If you do discover a fix, please consider putting in a pull request and I will add that to the library.

On Feb 11, 2015, at 10:35 PM, Phillip Rumple notifications@github.com wrote:

Creating the generator works, as does setting the frequency the first time. But if you try to call

toneGenerator->_channels[0].frequency = 720

it will change the sound, but it will not be a pure 720 Hz. It will be a bit distorted. If you start off the initWithChannels() with the frequency of 720 it sounds fine.

To get around this, I've had to create two tone generators that only operate in single channel mode. Not what I like to do. Do you have an idea of how to fix this?

— Reply to this email directly or view it on GitHub https://github.com/picciano/iOS-Tone-Generator/issues/2.