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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:11:58+00:00 2026-05-25T11:11:58+00:00

m making an app which requires to play recorded audio files. For that m

  • 0

m making an app which requires to play recorded audio files.
For that m having a sound.h/.m file and setting.h/.m file
In sound I have a method – update player which will update my audio-player if a new recorded files has been created.as follows..

-(AVAudioPlayer *)updatePlayer
{
  if (!mAudioPlayer) 
  {
    self.mAudioPlayer = [[[AVAudioPlayer alloc]initWithContentsOfURL:mURLObj error:nil]autorelease];
  }
    return mAudioPlayer;
}

Now , mcalling this metod every time when a new recorded audio file is created in settingcontroller..as follows..

-(void)hasNewRecorded:(BOOL)inFlag
{
    if (inFlag == YES)
    {
        mRecorder.mAudioPlayer = [[mRecorder updatePlayer]retain];
    }
    [mRecorder.mAudioPlayer release];
}

I know that m doing wrong somewhere..But couldnot able to fix the problem for last 2 days. I’m looking forward for your help.

  • 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-25T11:11:59+00:00Added an answer on May 25, 2026 at 11:11 am

    You are initiating a new audio player only if doesn’t exists here,

    if (!mAudioPlayer) 
      {
        self.mAudioPlayer = [[[AVAudioPlayer alloc]initWithContentsOfURL:mURLObj error:nil]autorelease];
      }
    

    A new player wont be allocated as a player exists already. So the old audio file will keep playing. Try fixing a breakpoint inside this for loop and check, If that’s the problem change the condition – release the old audio player and allocate new one.

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

Sidebar

Related Questions

I am making an app in which I have to open default audio player.
I am making an App in which i have to play music from iPod
i am making a app which takes photo on button click i have camera.java
I'm making some fancy app which requires lot of short sounds for its use.
I am making a simple web-app which requires login for the admin page. I
I'm making an app that requires internet connection for certain areas. I'm looking for
I am making an iphone app which requires me to make use of website
I am making an Android app which requires a main view with similar functionality
I am making an iPhone app which requires the current Stock Prices. I am
My app has a feature which requires identifying each app users. I'm planning making

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.