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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:48:50+00:00 2026-05-25T21:48:50+00:00

I have to task to develop an application which plays sound after user blow

  • 0

I have to task to develop an application which plays sound after user blow candles and than the sound should play. For blowing candle I have used AVAudioRecorder that catch user blow and than its starts animation of stopped candles and than it should start to play the song but its not playing the song. I have stored song locally.(in my application)

for AVAudioRecorder

    NSURL *url1 = [NSURL fileURLWithPath:@"/dev/null"];

    NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
        [NSNumber numberWithFloat: 44100.0], AVSampleRateKey,
        [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
        [NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
        [NSNumber numberWithInt: AVAudioQualityMax],  AVEncoderAudioQualityKey,
        nil];
    NSError *error1;

    recorder = [[AVAudioRecorder alloc] initWithURL:url1 settings:settings error:&error1];

animation images starts and after that song should be play.

imageView1.animationImages= [NSArray arrayWithObjects:
    [UIImage imageNamed:@"can6.png"],
    [UIImage imageNamed:@"can7.png"],
    [UIImage imageNamed:@"can8.png"],
    [UIImage imageNamed:@"can9.png"],
    [UIImage imageNamed:@"can10.png"],nil];
    [imageView1 setAnimationRepeatCount:1];
    imageView1.animationDuration=0.7;
    [imageView1 startAnimating];
    [recorder stop];
    player = [[AVAudioPlayer alloc] 
              initWithContentsOfURL:[NSURL fileURLWithPath:
             [[NSBundle mainBundle] pathForResource:xyz song ofType:nil]]
             error:nil];
    NSLog(@"music play-%@",xyz song);
    [player prepareToPlay];
    [player play];

All codes are working properly only sound is not playing.
I get candle stop animation starts but I can’t here the song. Although the above sound play code works in another view perfectly and its plays the song but it’s not playing the song here. Please help me.

  • 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-25T21:48:51+00:00Added an answer on May 25, 2026 at 9:48 pm

    Check that the result of [[NSBundle mainBundle] pathForResource:xyz song ofType:nil] is not nil. I think the problem might be passing nil for type. For example, if your song is HappyBirthday.mp3, you should call

    [[NSBundle mainBundle] pathForResource:@"HappyBirthday" ofType:@"mp3"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a problem. Developers have some kind of a task (develop certain feature), which
i am new in blackberry development. and i have task to develop the application
I have a task to develop a rails application following the model for routing.
I have a task to develop the application with map kit and web service
I am new in android development. and i have task to develop the application.
I have a task to develop the application, with the help of the SQL
I want to develop a functionality which will perform a certain task after a
I have a task to work with captcha in my application which gives the
I have been given the task to design and develop a web application for
I am new to iPad application development. I have task to develop an application

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.