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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:38:32+00:00 2026-05-18T01:38:32+00:00

HI, I am doing an iphone application that works with audio files. Application also

  • 0

HI,

I am doing an iphone application that works with audio files. Application also contains an audio converter, so I can potentially have a file of any audio format in my /Documents folder.

What I want is to implement a smooth audio file ending by reducing volume level at the end and fading it in at the beginning of the file.

How can I do that? (just point a direction. a framework, function, method)

I can use all Apple audio frameworks, both high level and low level ones.
I can even access audio buffers while file is being converted.

Thanks in advance.

NOTE: I do not need audio Fade in/out feature while PLAYING it. I need this feature already written in audio file.

  • 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-18T01:38:33+00:00Added an answer on May 18, 2026 at 1:38 am

    Because you are dealing with different formats, your best bet here is to apply the fade at the sample level when you are converting the data.

    If you are doing the conversion offline, then you already know the number of samples in the file, so you can process X - B samples normally (where X is the total number of samples and B is the fade duration):

    int i = 0;
    for(i = 0; i < X - B; i++) {
      sampleToBeConverted[i] = inputSample[i]
    }
    

    Then, for the last B samples, you’d do something like this:

    for(int j = 0; j < B; j++, i++) {
      sampleToBeConverted[i] = inputSample[i] * (1.0 - (j / B));
    }
    

    That would be for a linear fade slope, so if you want something fancier, well, then go knock yourself out. 😉 Basically, the formula for doing a linear fade is y = m * x + b (remember algebra class?), where your slope in this case is 1 / B, and the y offset is 1.0, which is the maximum volume gain you want to apply (ie, no gain).

    If you are doing the conversion in realtime, then you will need to keep B samples in a ringbuffer, and then apply the above algorithm when you reach the end of processing.

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

Sidebar

Related Questions

I'm doing some research on the feasibility of an iPhone application, and can't find
I am developing an iPhone application which works perfectly when doing a build &
I have found a crash in an iPhone application with target iOS 4 that
I'm on a project doing an iPhone application. We had a Cocoa consultant come
I've been doing iPhone development for the last 5 months or so, and have
I'm doing an iPhone application which uses a navigation control to browse through some
I am trying to design a feature in my application for the iPhone that
I'm building an app for iPhone/iTouch that I also want to run on iPads
We have an application that support iAds. Apparently iOs 4.2 for iPad will support
When doing TDD , how to tell that's enough tests for this class /

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.