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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:28:39+00:00 2026-05-13T10:28:39+00:00

I am using AVAudioplayer to play some audio files. I have some controls like

  • 0

I am using AVAudioplayer to play some audio files. I have some controls like forward and rewind.

Rewind is working properly but forward is not.

- (void)rewind
{
    AVAudioPlayer *player = _rewTimer.userInfo;
    player.currentTime-= SKIP_TIME;
    [_rewTimer invalidate];
    _rewTimer=nil;
    [self updateCurrentTime];
}

- (void)ffwd
{
    AVAudioPlayer *player = _ffwTimer.userInfo;
    player.currentTime-= SKIP_TIME;
    [player setCurrentTime:cTime];
    [_ffwTimer invalidate];
    _ffwTimer=nil;

    [self updateCurrentTime];
}

As soon as I click on forward button, the audio file just begins playing from the start.

I have followed the sample app avTouch from Apple.

  • 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-13T10:28:39+00:00Added an answer on May 13, 2026 at 10:28 am

    you might have done the property declaration of
    AVAudioPlayer *player;
    in the h file and also synthesised it.
    Now for forward, just do,

    - (void)ffwd
    {
        NSTimeInterval *time = [player currentTime];
        time+=SKIP_TIME;
        [player setCurrentTime:time];    
    
    }
    

    do similarly for rewind+

    OR

     - (void)ffwd{
        NSTimeInterval time = avPlayer.currentTime;
     time+=SKIP_TIME;
        if (time > avPLayer.duration)
        {
           //nothing to do
    
        }
        else
            [player setCurrentTime:time];
        }
    

    this one seems the better way, also for rewind compare to 0 instead of duration

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

Sidebar

Related Questions

I am using multiple instances of AVAudioPlayer to play multiple audio files simultaneously. I
I'm trying to play sequence of audio files in the background using AVAudioPlayer. When
Alright I have two problems. I'm using AVAudioPlayer to play a simple audio file
I am using AVAudioPlayer to play a 15 audio files. The audio files need
I am using AVFoundation to play wav files. But i could not make it
i tried to play an audio file from internet using AVAudioplayer but there is
I am using the AVAudioPlayer class to play .mp3 files in my App. Is
I am using the AVAudioPlayer framework, and I have several sounds that play one
I am using AVAudioPlayer object to play an audio. I created an audioPlayer object
I want to play some videos with audio from different audio files. For this

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.