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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:48:48+00:00 2026-06-07T20:48:48+00:00

I am trying to have an audio only player in my App which can

  • 0

I am trying to have an audio only player in my App which can play in the background.
Initially I used the MPMoviePlayerController, which worked fine, but the problem was that it doesn’t support searching forward and backwards (or use a slider).

Some of the recordings are an hour long, and if somebody is interrupted during it and want to go back to the place they were they have to start from the beginning. Using AVAudioCoder seemed to me to be the solution so I changed my code to discover that it doesn’t work with URL which are not on the device.

I do use Http Live Streaming, and have an .m3u8 file. Is there a easy to implement a solution to use .m3u8 and .mp3 files from an internet source with the ability to change the playback location using a slider. (and as it needs to play in the background, I cannot use the interface of the MPMoviePlayerController)

Update:
Back using the MPMoviePlayerController, but some strange behavior. When playing the .m3u8 playlist, and setting the new position, the value given when querying the currentPlaybackTime is set to the right value, but the sound continues to play as if not interrupted.

When pausing the player, then setting the time it just ignores it and also keeps playing, but at least the ‘currentPlaybackTime’ gives the right current position.

id appDelegate = (iDomsAppDelegate *)[[UIApplication sharedApplication] delegate];
double length = [[appDelegate audioPlayer] duration];
if(length > 0){
float sliderValue = [_slider value];
double time = sliderValue / 100 * length;

NSTimeInterval playBackTime = time;

NSLog(@"Requested time: %f vs current time %f", playBackTime, [[appDelegate audioPlayer] currentPlaybackTime]);
//[[appDelegate audioPlayer] pause];
[[appDelegate audioPlayer] setCurrentPlaybackTime:playBackTime];
//[[appDelegate audioPlayer] setInitialPlaybackTime:playBackTime];
//[[appDelegate audioPlayer] play];
NSLog(@"Requested time: %f vs current time %f (2)", playBackTime, [[appDelegate audioPlayer] currentPlaybackTime]);

}

Every second I update the labels, and this gives me the behavior as described above:

id appDelegate = (iDomsAppDelegate *)[[UIApplication sharedApplication] delegate];

double time = [[appDelegate audioPlayer] currentPlaybackTime];
double length = [[appDelegate audioPlayer] duration];
NSLog(@”State: %i, Time: %f”, [[appDelegate audioPlayer] playbackState], [[appDelegate audioPlayer] currentPlaybackTime]);
if(length > 0){
double pos = time/length * 100;
[_slider setValue:(float)pos];
[_slider setEnabled:true];

NSInteger seconds = (int) length % 60;
NSInteger minutes = ((int) length / 60) % 60;

double playableDuration = [[appDelegate audioPlayer] playableDuration];
if(playableDuration > 0 && playableDuration < length){
    int downloaded = (int)((float)((float)playableDuration / (float)length) * 100);
    [_unknownLength setText:[NSString stringWithFormat:@"Total duration: %02i:%02i (%02i%% downloaded)", minutes, seconds, downloaded]];   
} else {
    [_unknownLength setText:[NSString stringWithFormat:@"Total duration: %02i:%02i", minutes, seconds]];       
}

} else {
[_slider setEnabled:false];
[_unknownLength setText:[NSString stringWithFormat:@”Total duration unknown”]];
}

NSInteger seconds = (int) time % 60;
NSInteger minutes = ((int) time / 60) % 60;
[_position setText: [NSString stringWithFormat:@”%02i:%02i”, minutes, seconds]];

  • 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-07T20:48:50+00:00Added an answer on June 7, 2026 at 8:48 pm

    Segmentation for audio only for FFMPEG did not work correctly, but is now fixed in the head of the GIT repo. Using MPMoviePlayer controller works perfect now, quickly being able to find in steps of the segment size.

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

Sidebar

Related Questions

I'm trying to have the audio file play as soon as the view controller
I have a database which contains the link to audio files. I am trying
I am trying to implement 'volume automation' in a jQuery audio player I have
I'm trying to play an audio in background from a WebView. This audio is
I am trying to add a player that will play audio on the site.
I'm trying to have the user pick an audio file and store the path
Afternoon, I am trying have an HTML file containing a frameset which contains two
I have a cache directory I'm trying to have ignored by git which lives
I have application which use JNA and gets the audio and video. It works
I'm trying to create a simple looping feature using HTML5 audio and have a

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.