Google
www ResExcellence

Application Makeovers
Desktop Snapshots
iTunes Skins
Mighty Mouse Cursors
Uploads
Boot Images
Dock Poofs
Links List
Photoshop Goodies
Users Forum
Boot Panels
Download Stats
Log-In Panels
REALbasic
Clocks
GUI Software
Mac OS X Mods
Safari Stuff
Desktop Pictures
Icons
Mac OS X Themes
Splash Screens
Homepage
Download a free demo of REALbasic!
Download a free demo of REALbasic!
Recent Articles...
3D
3D Photo Gallery (Part 2)
3D Photo Gallery (Part 1)

Audio
iPod Tricks (Part 3)
iPod Tricks (Part 2)
iPod Tricks (Part 1)
Laugh Track Machine
Audio Player with Reverb
Shepard Melody
RB Phone Home
Build a Drum Machine

Custom Controls
Custom Buttons
Custom Buttons Part II
iTunes-style Listboxes
Custom Controls

General RB
Wiggle Window
JPEG in PDF
Hey! You got your Checkbox in my Listbox!
Background Applications
Listbox Auto-Find
Virtual Volumes
Time Tracker
Software Distribution (Part 4)
Software Distribution (Part 3)
Software Distribution (Part 2)
Software Distribution (Part 1)
Exceptions
Living on the Edge
Tips and Tricks
Review of REALbasic 3.0
Text Clippings Made Easy

Graphics
Image Spinner
Cropping Graphics (Part 4)
Cropping Graphics (Part 3)
Cropping Graphics (Part 2)
Cropping Graphics (Part 1)
Shimmer Graphics
Lissajous Figures
Simple Screen Capture
Vector Graphics
Kaleidoscope Images
Stegonography
Spirals!
Image Table
RB Magnifying Lens
Screen Capture
Color Picker Tutorial

Hacks
Ghost Grab
Speedy Mouse Extension
iTunes Plugins
iTunes Skinner

Internet
Display Web Image In Canvas
HTML IMG Tags
Version Tracking
Even Smarter Instant Messaging
Web Tiler
JavaScript and REALbasic
Stock Ticker (Part 2)
Stock Ticker (Part I)
AIM Mate

Mac OS X
Using Sheets in REALbasic
Build a Bundle (Part 2)
Build a Bundle (Part 1)
Dock Your Passwords
Mac OS X Debugging
REALbasic Mac OS X Icon Tutorial
Animate Your Dock
RB and the Command Line

Novelty
Guessing Game
Calendar Trivia
Tile Mixer
Zip Code Finder
Happy Valentine's Day
Merlin Simulator (Part 3)
Merlin Simulator (Part 2)
Merlin Simulator (Part 1)
Buzzword Machine
AppleSoft BASIC

Printing
Print to PDF

Registration
Registration Code Validation
Network Registration Codes

Resources
Picture Extractor (Part 2)
Picture Extractor (Part 1)

Serial
Caller ID (Part 3)
Caller ID (Part 2)
Caller ID (Part 1)

Speech
Speech Recognition

Video
Big Brother Video Capture

Newest Dev Tools!




Book Alert !
REALbasic for Dummies
by Erick Tejkowski
$19.99 @ Amazon

Made with REALbasic!

Problems?
Downloads are in StuffIt 5 format (free download).
Tell me about a bad link (Thanks!).
Submission Policy

10-25-01

REALbasic Phone Home by Erick Tejkowsi

This week we'll create a fun REALbasic project that spits out audio files. These audio files will play a tone like your telephone produces when you press the number keys.

Background

Telephones keypads in the United States produce tones in a unique manner called "DTMF". DMTF stands for Dual-Tone Multi-Frequency. There's no need to sweat the terminology if you're a technophobe. All it really means is that each row and column on a telephone keypad produces a unique tone. In other words, The 1, 4, 7, and * keys all share a common tone, and keys 1, 2, 3 produce a common tone. When you press a key, it sounds two simultaneous tones (hence the Dual in DTMF). If you'd like to hear the tone for a particular row or column, pick up your telephone and press two keys in the same row or column. The tone you hear is the frequency that the row or column shares. For the technically inclined out there, these tones are pure sine waves. So, in our code, we will produce audio files that contain sine waves of the two tones for any particular telephone key. If you'd like to know more about how DTMF and phones work, there's lots of info on the web. Try this site or do a search on Google for DTMF. The good news is that I (along with some help from Cubie award winner Wade) have taken care of the hard part of creating the tones for you and put them in a RB class. You just have to "wire up" the class in your own project to take advantage of it. So, let's get started.

Build the Interface

Launch REALbasic and open Window1. To the window add 12 PushButtons and rename the "1" key, giving it a name like "NumKey" and change its Index property to a value of 0 (zero). Then copy the "NumKey" name to the clipboard and select the "2" key and paste the name in for this key. When you press return, you should notice that the Index property will automatically increment to the next available number. Continue in this fashion for each key. When you're finished, you should have twelve PushButtons that share the same name, but each with a unique index number between 0 and 11 inclusive.

Next, add a checkbox to the window and give it some descriptive text. We will use this checkbox to decide if we want the two tones played together as we do on a phone, or separated between the stereo field, with one tone in the left speaker and one in the right. This is just so you can hear the tones separated like the example above where you pressed two keys on the phone at once.

Finally, add a ChasingArrow control to the window and make it invisible by unchecking its Visible property. It takes a little while to produce an audio file, so we will use this to show the user that we are hard at work producing the file. You may arrange the interface however you want, but it might look something like this.

interface.jpg (10k)

Add the Code

To create phone tones, you'll need to either download the phone tone class or download the completed project listed at the end of this tutorial. If you choose to download the class, drag it into your project window. If you download the completed project, it already contains the class.

Next, enter the following code in the Action event of any of the Window1 PushButtons (they share the same code since they are an array of controls):

code.jpg (36k)

First, this code turns on the ChasingArrows to show that a process is taking place. Then the code asks for a file where the user may save the audio. If one is chosen, the code then creates a new object based on the phone tone class (named "System7Creator"). Once the object is created, we send it the following messages:

  • SFILCreatePhoneNumberWave - creates the audio sine wave data based on which key was pressed
  • SetOutputFile - hopefully self-explanatory
  • MakeFile - make the sucker!

When the code has done its thing, hide the ChasingArrows again.

Conclusion

Well, that's it! Run the project and when you're happy with the results, build it. This project should work just fine on Carbon as well. If you'd like to download this week's example instead of typing it in, you can download the completed project. Oh, and if you've made it this far... look at the first and last initials in my name versus the title of this project to see if you can figure out my poor excuse for humor. Honest, there's a joke in there somewhere. See you next week!


10-16-01

REALbasic News by Erick Tejkowsi

Slap a few Frogs Frogslapper is another fine product from Stimpsoft, Made with REALbasic - fully OS X ready, totally rewritten. Frogslapper is a light, free POP3 email checker.

Search plugin Thomas Reed has released the first alpha of a plugin entitled MSSearch. The MSSearch Plugin provides a search class capable of searching for multiple search terms in one pass. It's free including the source code.

REAL Control Strip INTELLI INNOVATIONS has posted REAL Control Strip free-of-charge for inclusion with any application (commercial or non-commercial). Additionally, the complete source code is now bundled with the software for public use and modification.

iScreenSaver iScreensaver Designer for Windows and Macintosh version 2.0beta11 is available:

Game Code Looking for some good REALbasic gaming code? Don't miss iDevGames. They specialize in Mac programming, with particular focus to gaming. Source code is included for many languages, including REALbasic.


Application Makeovers
Desktop Snapshots
iTunes Skins
Mighty Mouse Cursors
Uploads
Boot Images
Dock Poofs
Links List
Photoshop Goodies
Users Forum
Boot Panels
Download Stats
Log-In Panels
REALbasic
Clocks
GUI Software
Mac OS X Mods
Safari Stuff
Desktop Pictures
Icons
Mac OS X Themes
Splash Screens
Homepage

Maintained by the Staff of ResExcellence. This entire site ©1997-2003 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.

[an error occurred while processing this directive]on the ResEx LinuxPPC Server