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

  • Home
  • SEARCH
  • 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 8977007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:16:33+00:00 2026-06-15T19:16:33+00:00

How do I play a sound simultaneously with the camera shutter going off? In

  • 0

How do I play a sound simultaneously with the camera shutter going off?

In my application, I have an inset camera preview. It takes 3 pictures automatically after 5 seconds of the activity starting. During this time the application is receiving a range of values via Bluetooth. Everytime the values are greater than a preset threshold, the application plays a tone, which is done using MediaPlayer.

The problem is that when the camera goes off, the shutter click sound seems to take over all the audio, and the tone being played stops and only resumes after the 3 shutter clicks. I don’t want to silence the camera shutter, so is there a way I can get the tone to play with shutter clicks? This is all happening in one activity.

Thanks

  • 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-15T19:16:34+00:00Added an answer on June 15, 2026 at 7:16 pm

    One possible solution would be to use the hidden ENFORCED_AUDIBLE stream type for your tones. This is the stream type that the camera shutter sound most likely will use, so it won’t be muted unless the shutter sound has been muted.

    Note that this stream type wasn’t introduced until ICS (or maybe it was GB/HC, I can’t say for sure off the top of my head), so it won’t be compatible with every version of Android in existence. The integer value for this stream type identifier is 7, but if you want to check if exists / get its value programmatically you might be able to do so using reflection on the AudioSystem class.

    Here’s an example of how this could be done:

    public static boolean mHasEnforcedStream = true;
    public static int STREAM_SYSTEM_ENFORCED = 0;
    
    ...
    
    static
    {        
        try
        {
            Class asClass = Class.forName("android.media.AudioSystem");
            Field sseField = asClass.getDeclaredField("STREAM_SYSTEM_ENFORCED");
            STREAM_SYSTEM_ENFORCED = sseField.getInt(null);
        }
        catch (Exception e)
        {
            mHasEnforcedStream = false;
        }
    }
    

    Keep in mind that if you use this stream type you’ll always get your tones in the loudspeaker even if the user has e.g. a 3.5mm wired headset attached, and even if the user has put his/her phone in silent mode.

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

Sidebar

Related Questions

How to record sound and play simultaneously in iphone SDKs programmatically? If anybody have
I've been trying to play more than one sound simultaneously in the iPad browser,
I'm developing simple android application, using Media Player to play sound. It has a
My application needs to play sound files. The only cross-platform file format I can
From How can I play sound in Java? Is it possible to have resouce
I want to play sound when button clicked, I have different the sounds,I list
I have a Silverlight application that uses an overridden AudioSink.OnSamples() to record sound, and
I have an app which does listen and play sound at the same time.
I would like to play sound after touching the button. MediaPlayer works fine, but
I'd like to play different sound on headphones and speaker simultaneously in iOS5. Specifically

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.