---
title: "Notification with sound although phone is muted?"  
description: "Notification with sound although phone is muted?"  
author: "Anonymous User"  
published: 2014-10-14  
updated: 2014-10-14  
canonical: https://www.mindstick.com/forum/2380/notification-with-sound-although-phone-is-muted  
category: "android"  
tags: ["android", "mobile development"]  
reading_time: 2 minutes  

---

# Notification with sound although phone is muted?

I am creating a [notification](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) with [Android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios)'s NotificationManager.

Is it possible to 'override' the phone's volume (mute) [settings](https://www.mindstick.com/blog/63563/steps-to-change-the-wireless-settings-using-linksys-cloud-account) in such a way, that the notification's [sound](https://answers.mindstick.com/qa/35122/who-won-an-oscar-award-recently-for-best-sound-mixing) is ALWAYS played?

The reason I need this is the following: The notification is so important, that vibration alone may not be enough. The [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) [MUST](https://www.mindstick.com/articles/12978/top-reasons-why-every-magento-ecommerce-store-must-opt-for-mobile-app) be alerted. So a sound shall be played, even [if the phone](https://answers.mindstick.com/qa/108759/what-if-the-phone-screen-is-flickering) is muted or the volume is very low.

## Replies

### Reply by Anonymous User

You can change RINGING mode like this from silent to normal.

```
AudioManager mobilemode = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);        mobilemode.setRingerMode(AudioManager.RINGER_MODE_NORMAL);        // Turn on all sound        // turn on sound, enable notifications        mobilemode.setStreamMute(AudioManager.STREAM_SYSTEM, false);        //notifications        mobilemode.setStreamMute(AudioManager.STREAM_NOTIFICATION, false);        //alarm        mobilemode.setStreamMute(AudioManager.STREAM_ALARM, false);        //ringer        mobilemode.setStreamMute(AudioManager.STREAM_RING, false);        //media        mobilemode.setStreamMute(AudioManager.STREAM_MUSIC, false);        // Turn off all sound        // turn off sound, disable notifications        mobilemode.setStreamMute(AudioManager.STREAM_SYSTEM, true);        //notifications        mobilemode.setStreamMute(AudioManager.STREAM_NOTIFICATION, true);        //alarm        mobilemode.setStreamMute(AudioManager.STREAM_ALARM, true);        //ringer        mobilemode.setStreamMute(AudioManager.STREAM_RING, true);        //media        mobilemode.setStreamMute(AudioManager.STREAM_MUSIC, true);
```

\

**FOR YOUR CASE YOU CAN TRY SOMETHING LIKE THIS**

```
int previousNotificationVolume =mobilemode.getStreamVolume(AudioManager.STREAM_NOTIFICATION);        mobilemode.setStreamVolume(AudioManager.STREAM_NOTIFICATION,mobilemode.getStreamMaxVolume(AudioManager.STREAM_NOTIFICATION), 0);        // Play notification sound        // Set notification sound to its previous         mobilemode.setStreamVolume(AudioManager.STREAM_NOTIFICATION,previousNotificationVolume, 0);
```

### Reply by Anonymous User

yes it is possible.\

```
MediaPlayer mMediaPlayer;Uri notification = null;notification = RingtoneManager                .getDefaultUri(RingtoneManager.TYPE_ALARM);mMediaPlayer = new MediaPlayer();        mMediaPlayer.setDataSource(ctx, notification);        // mMediaPlayer = MediaPlayer.create(ctx, notification);        final AudioManager audioManager = (AudioManager) ctx                .getSystemService(Context.AUDIO_SERVICE);        mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);        mMediaPlayer.prepare();        // mMediaPlayer.start();        mMediaPlayer.setLooping(true);        mMediaPlayer.setOnPreparedListener(new OnPreparedListener() {            public void onPrepared(MediaPlayer arg0) {                mMediaPlayer.seekTo(0);                mMediaPlayer.start();            }        });
```


---

Original Source: https://www.mindstick.com/forum/2380/notification-with-sound-although-phone-is-muted

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
