Latest 0.0.1
Homepage https://github.com/fourtalk/iOS-Tone-Generator
License MIT
Platforms ios , requires ARC
Frameworks AudioToolbox, AVFoundation
Authors

iOS-Tone-Generator

Tone Generator for iOS

A reusable Tone Generator class roughly based upon the fine work of Matt Galagher, http://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html

A reusable class for generating simple sine waveform audio tones with specified frequency and amplitude. Can play continuously or for a specified duration.

Multiple Channels

You can add more than one tone channel, for example to generate DTMF
tones. These are the tones you may hear when dialing on a keypad (either analog or even on iOS in the Telephone.app)

DTMF Keypad

unichar c = '2'; // Example character, from a keypad

TGSineWaveToneGenerator *gen = [[TGSineWaveToneGenerator alloc] initWithChannels:2];
// DTMF keypad frequencies
double freqA[] = {1209, 1336, 1477};
double freqB[] = {697, 770, 852};
if (c == '0') {
    _toneGenerator->_channels[0].frequency = 1336;
    _toneGenerator->_channels[1].frequency = 941;
} else if ('0' < c && c <= '9') {
    c = c -'1';
    _toneGenerator->_channels[0].frequency = freqA;
    _toneGenerator->_channels[1].frequency = freqB;
} else if (c == '#') {
    _toneGenerator->_channels[0].frequency = 1477;
    _toneGenerator->_channels[1].frequency = 941;
} else {// Not sure
    _toneGenerator->_channels[0].frequency = 1209;
    _toneGenerator->_channels[1].frequency = 941;
}
[_toneGenerator playForDuration:0.15];

Latest podspec

{
    "name": "TGSineWaveToneGenerator",
    "version": "0.0.1",
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/fourtalk/iOS-Tone-Generator",
    "authors": {
        "Anthony Picciano": "https://github.com/picciano"
    },
    "summary": "Tone Generator for iOS.",
    "description": "A reusable Tone Generator class roughly based upon the fine work of Matt Galagher, http://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.htmlnA reusable class for generating simple sine waveform audio tones with specified frequency and amplitude. Can play continuously or for a specified duration.",
    "source": {
        "git": "https://github.com/fourtalk/iOS-Tone-Generator.git",
        "tag": "v0.0.1"
    },
    "source_files": "TGSineWaveToneGenerator.{h,m}",
    "platforms": {
        "ios": null
    },
    "frameworks": [
        "AudioToolbox",
        "AVFoundation"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This