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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:17:42+00:00 2026-05-24T07:17:42+00:00

I am adding an Audio session property listener for kAudioSessionProperty_AudioRouteChange and in the callback

  • 0

I am adding an Audio session property listener for kAudioSessionProperty_AudioRouteChange and in the callback I want to call the takePicture function of UIImagePickerController. The problem is that I cannot access my picker in the callback.

I am initializing my picker in viewDidLoad. I have tried declaring the picker as both a private and public object and accessing with picker or self.picker but it always gives the “Use of undeclared identifier” error. I use this code to add the listener:

AudioSessionInitialize(nil, nil, nil, nil);
AudioSessionSetActive(true);
AudioSessionAddPropertyListener(
                                kAudioSessionProperty_AudioRouteChange,
                                applicationAudioRouteDidChange,
                                self);

This is my callback:

void applicationVolumeDidChange(void *inClientData,
                                AudioSessionPropertyID inID,
                                UInt32 inDataSize, const void *inData)
{
    NSLog(@"Volume changed");
    //[picker takePicture]; Error

}

I also declared an NSArray to see if this was the problem with UIImagePickerController only but the array also gives the same error.

  • 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-24T07:17:43+00:00Added an answer on May 24, 2026 at 7:17 am

    The last parameter of AudioSessionAddPropertyListener() is there so you can pass whatever you like into the callback.

     OSStatus AudioSessionAddPropertyListener (
           AudioSessionPropertyID         inID,
           AudioSessionPropertyListener   inProc,
           void                           *inClientData
        );
    

    You are passing self so within the callback the void *inClientData parameter is a pointer to whichever object self is.

    If self was an instance of UIImagePickerController then,

    UIImagePickerController *picker = inClientData;
    [picker takePicture];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a good open-source library that uses Apple's private frameworks to add audio
I've been fiddling with the hell that is HTML5 video/audio for a couple of
I am currently adding extra sounds to my game. The problem is I have
I would like to include audio that will automatically play when the user scrolls
This is not the No video, audio only problem . It's just the opposite
Is there a free alternative to Soundbooth for adding cue-points to audio tracks for
I have a source that streams wav audio in alaw format which I would
I'm having trouble adding in jQuery's toggleClass function into the rest of my code.
I have an MPMoviePlayerViewController that plays audio. I would like to remove the Quicktime
I want to record a live stream in flex for that what i am

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.