Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 930273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:18:25+00:00 2026-05-15T20:18:25+00:00

I want to develop an application for the iPhone that generates custom DTMF tones.

  • 0

I want to develop an application for the iPhone that generates custom DTMF tones. I assume the pure tone will be played from a memory buffer and not from an uploaded file, and I think I should use AVAudioPlayer class and the method “initWithData:error:”, but how do I implement it? Whatever I do, I can’t make it work!

I saw this code in the forum that is needed in order to calculate the sinus wave:

const int PLAYBACKFREQ = 44100;
const float PI2 = 3.14159265359f * 2;

void generateDTMF(short *buffer, int length, float freq1, float freq2) {
  int i;
  short *dest = buffer;
  for(i=0; i<length; i++) *(dest++) = (sin(i*(PI2*(PLAYBACKFREQ/freq1))) + sin(i(PI2(PLAYBACKFREQ/freq2)))) * 16383;
}

But where should I place this code? How does it help me to fill a designated memory buffer?

Any kind of help would be appreciated!

Sagiftw

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:18:26+00:00Added an answer on May 15, 2026 at 8:18 pm

    The data which you pass to the AVAudioPlayer instance method initWithData:error: must have a valid audio file header. You can use a WAVE file header, AIFF file header, or a CAF file header. Since your data format is fixed, you can just create a static header for the duration of the audio you’re generating.

    The alternative is to go lower level and use AudioQueue to directly play audio buffers. This might end up being easier depending on how much control you want over playback, or if you want playback to happen indefinitely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop an application for the iPhone that creates a custom memory
I want to develop an iphone application that needs an english word dictionary. Can
I want to develop an iphone application where u can change the language from
I want to develop application that sends image/txt or any file from one android
I'd like to develop a Mac application that builds custom static libraries for iPhone
I want to develop an iPhone application which has to record the phone conversation.
I want to develop an ebook application for iPhone. I'm new to iPhone developement,
I want to develop and deploy application on iPhone and Android. However there is
I want to develop a little iPhone application, just for my personal needs. I
I want to develop an application that does a bunch of cool stuff. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.