{"id":4210,"date":"2021-11-11T17:01:04","date_gmt":"2021-11-11T09:01:04","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4210"},"modified":"2022-04-08T18:14:58","modified_gmt":"2022-04-08T10:14:58","slug":"mute-audio-video-stream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/mute-audio-video-stream\/","title":{"rendered":"Mute \/ Unmute Audio &#038; Video Stream: Android SDK &#8211; Video API"},"content":{"rendered":"\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#mute-unmute-audio\">Mute \/ Unmute Audio in a Stream<\/a><\/li><li><a href=\"#mute-unmute-video\">Mute \/ Unmute Video in a Stream<\/a> <\/li><\/ul>\n\n\n\n<a name=\"mute-unmute-audio\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Mute \/ Unmute Audio in a Stream<\/h2>\n\n\n\n<p>The <code>EnxStream.muteSelfAudio()<\/code> method is used to mute\/unmute Audio of the Local Stream. <\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxStream<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong> <code>public void muteSelfAudio( isMute )<\/code><\/p>\n\n\n\n<p><strong>Parameter:<\/strong>  <code>isMute<\/code> &#8211;  <em>true<\/em> to mute<em> and false<\/em> to unmute Audio.<\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>onRemoteStreamAudioMute<\/code> &#8211; Notification to everyone in the Room when a user mutes self Audio.  <\/li><li><code>onRemoteStreamAudioUnMute<\/code>  &#8211; Notification to everyone in the Room when a user unmutes self Audio.<\/li><li><code>onAudioEvent <\/code>&#8211; Acknowledgment to the user when self Audio is muted\/unmuted.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">localStream.muteSelfAudio(true); \/\/ To mute audio of local stream\nlocalStream.muteSelfAudio(true); \/\/ To unmute audio of local stream\n\n\/\/ To self. Audio is muted\/unmuted.\npublic void onAudioEvent(JSONObject json) {\n   \/\/ json { \"result\":0, \"msg\": \"Audio Off\" }  \n   \/\/ json { \"result\":0, \"msg\": \"Audio On\" }  \n}\n\n\/\/ To all. Audio muted by Remote user.\npublic void onRemoteStreamAudioMute(JSONObject json) { \n   \/\/ json {\"result\":0, \"msg\":\"User muted audio\", \"clientId\": \"XXX\" }   \n}\n\n \/\/ To all. Audio unmuted by Remote user.\npublic void onRemoteStreamAudioUnMute(JSONObject json) { \n   \/\/ json {\"result\":0, \"msg\":\"User unmuted audio\", \"clientId\": \"XXX\" }   \n} <\/pre>\n\n\n\n<p><strong>Error Codes \/ Exceptions<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5058<\/td><td>Repeated <code>muteSelfAudio()<\/code> call made while a previous mute request is in process.<\/td><\/tr><tr><td>5059<\/td><td>Repeated <code>muteSelfAudio()<\/code> call made while a previous unmute request is in process.<\/td><\/tr><tr><td>5060<\/td><td>Repeated <code>muteSelfAudio()<\/code> call made after Audio has been muted already.<\/td><\/tr><tr><td>5061<\/td><td>Trying to unmute Audio without muting it first.<\/td><\/tr><tr><td>5062<\/td><td>Unable to unmute Audio as Audio hard-muted by the Moderator.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<a name=\"mute-unmute-video\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Mute \/ Unmute Video in a Stream<\/h2>\n\n\n\n<p>The <code>EnxStream.muteSelfVideo()<\/code> method is used to mute\/unmute Video of the Local Stream.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxStream<\/code><\/p>\n\n\n\n<p><strong>Methods:<\/strong>  <code>public void muteSelfVideo( isMute )<\/code> <\/p>\n\n\n\n<p><strong>Parameter:<\/strong> <code>isMute<\/code> &#8211; <em>true<\/em> to mute, <em>false<\/em> to unmute Video.<\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul><li><code>onRemoteStreamVideoMute<\/code> &#8211; Notification to everyone in the Room when a user mutes self Video.<\/li><li><code>onRemoteStreamVideoUnMute<\/code>  &#8211; Notification to everyone in the Room when a user unmutes self Video.<\/li><li><code>onVideoEvent <\/code>&#8211; Acknowledgment to the user when self Video is muted\/unmuted.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">localStream.muteSelfVideo(true); \/\/ To mute video of local stream\nlocalStream.muteSelfVideo(false); \/\/ To unmute video of local stream\n\n\/\/ To self. Video is muted\/unmuted.\npublic void onVideoEvent(JSONObject json) {\n   \/\/ json { \"result\":0, \"msg\": \"Video Off\" }  \n   \/\/ json { \"result\":0, \"msg\": \"Video On\" }  \n}\n\n\/\/ To all. Video muted by Remote user\npublic void onRemoteStreamVideoMute(JSONObject json) { \n   \/\/ json {\"result\":0, \"msg\":\"User muted video\", \"clientId\": \"XXX\" }     \n}\n\n\/\/ To all. Video unmuted by Remote user\npublic void onRemoteStreamVideoUnMute(JSONObject json) {  \n   \/\/ json {\"result\":0, \"msg\":\"User unmuted video\", \"clientId\": \"XXX\" }   \n} <\/pre>\n\n\n\n<p><strong>Error Codes \/ Exceptions<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5020<\/td><td>Unable to process muteSelfVideo() when the user has denied Camera permission.<\/td><\/tr><tr><td>5071<\/td><td>Repeated <code>muteSelfVideo()<\/code> call made while a previous request is in process.<\/td><\/tr><tr><td>5063<\/td><td>Repeated <code>muteSelfVideo()<\/code> call made after Video has been muted already.<\/td><\/tr><tr><td>5064<\/td><td>Repeated <code>muteSelfVideo()<\/code> call made after Video has been unmuted already.<\/td><\/tr><tr><td>5065<\/td><td>When the user tries to unmute Video without muting it first. Non-Contextual Method call.<\/td><\/tr><tr><td>5066<\/td><td>Unable to unmute Video as Video hard-muted by the Moderator.<\/td><\/tr><tr><td>5070<\/td><td>Unable to unmute Video in Audio-only call mode.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/switch-camera-mic-speaker\/\">Switch Camera, Mic, Speaker<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/subscribing-remote-streams\/\">Subscribe Remote Stream<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents Mute \/ Unmute Audio in a Stream Mute \/ Unmute Video in a Stream Mute \/ Unmute Audio in a Stream The EnxStream.muteSelfAudio() method is used to mute\/unmute Audio of the Local Stream. Class: EnxStream Methods: public void muteSelfAudio( isMute ) Parameter: isMute &#8211; true to mute and false to unmute Audio. Callbacks: onRemoteStreamAudioMute &#8211; Notification to everyone in the Room when a user mutes self Audio.&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3740,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Table of Contents Mute \/ Unmute Audio in a Stream Mute \/ Unmute Video in a Stream Mute \/ Unmute Audio in a Stream The EnxStream.muteSelfAudio() method is used to mute\/unmute Audio of the Local Stream. Class: EnxStream Methods: public void muteSelfAudio( isMute ) Parameter: isMute &#8211; true to mute and false to unmute Audio.&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4210"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4210"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4210\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3740"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}