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 8789535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:26:07+00:00 2026-06-13T22:26:07+00:00

I have created an iOS 5/iOS 6 app with a display that responds to

  • 0

I have created an iOS 5/iOS 6 app with a display that responds to changes in the musical pitch performed by the user. It uses the record function in the sample SpeakHere code but does not actually save a file because it is designed to respond in real time.

I would now like to extend this app to respond simultaneously to the pitch itself and the duration that the same pitch is sustained (for example, changing the color when the same pitch is held steadily for a minimum period of time). I have been reading about NSTimer and NSDate functions, which seem straightforward, as well as AudioTimeStamp functions, which are apparently C based and which I find very confusing. Based on other posts, it seems like NSTimer and NSDate checks might cause the display’s real-time response to an actual musical performance to lag. How about dispatchAfter? Could I expect the block to execute at the scheduled time?

My question is, what approach is most likely to yield the desired result of allowing me to measure duration of a particular pitch in the AudioQueue and update my display continuously in real time? Do I need to be saving to a file for this to work?

I am self-taught and have only been programming for a few months, so no matter what I will have to do a lot of learning of APIs/C language features that are new to me. I’m hoping someone can point me in a fruitful direction. Thanks!

  • 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-06-13T22:26:09+00:00Added an answer on June 13, 2026 at 10:26 pm

    You’re definitely getting into pretty advanced stuff here. Here are a few thoughts:

    1. Your audio processing seems to be the most intensive operation. Because this processing needs to be continuous, you’re probably going to have to do this processing in another thread. By processing, I mean examining the audio to determine pitch.

    2. Once you’ve identified the pitch, you should store the time for which it began.

    3. Then, in the main thread, setup an NSTimer that repeats continuously and in the NSTimer’s fire method, subtract the pitch’s start date from the current date to get the elapsed time, as an NSTimeInterval.

    4. Send the NSTimeInterval to your display logic so that you can update the color on screen.

    Some things to check out:

    Beginner’s tutorial on multi-threading and Grand Central Dispatch on iOS
    NSTimer

    Using NSTimers

    Hope that helps you out!

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

Sidebar

Related Questions

in an iOS app I have to display a list of text items that
I have created a class for fetching server-side data in my iOS-App, based on
I have an iOS app I created as a view-based app in xCode. I
I have created an app targeted for ios 4.1 with base SDK ios 5.0
I have a universal iOS app with a custom view that has three buttons,
I have created an iOS 4.0 app with a Settings bundle. I am using
I have an iOS (Obj-C) project that uses ARC (Automatic Reference Counting). According to
I have an iOS app that has a UITableView with custom TableViewCells that contain
I have an app that displays a map of the user's location and tracks
I created an iOS app that allowed me to enter data into database and

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.