{"id":83195,"date":"2021-08-02T09:00:32","date_gmt":"2021-08-02T03:30:32","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=83195"},"modified":"2024-08-04T21:02:39","modified_gmt":"2024-08-04T15:32:39","slug":"android-audio-manager","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/","title":{"rendered":"AudioManager in Android with Examples"},"content":{"rendered":"<p>Most often, whenever we get calls or messages, then our device plays a ringtone. Did you ever think about how these work? These all are handled through the Android AudioManager. The Audio Manager helps us to handle system ringtones, their modes, and their volumes.<\/p>\n<p>This article will cover every use case and aspect of Audio Manager and Audio Capture. By the end of this article, you will be very comfortable dealing with these things.<\/p>\n<h3>Android AudioManager<\/h3>\n<p>Audio Manager helps to control your phone ringtone, its modes, and its volume. Whenever you require adjusting your phone ringtone volume or changing the mode, you particularly need the Audio Manager. There are several modes present in Audio Manager that are as follows:<\/p>\n<ul>\n<li>Ringing<\/li>\n<li>Vibration<\/li>\n<li>Loud<\/li>\n<li>Silent, etc<\/li>\n<\/ul>\n<p>Android Audio Manager is a class in Android that helps you to implement the above-stated functionalities. So first, you need to create an Android Audio Manager class object and then use the setRingerMode() method.<\/p>\n<p>So, now let\u2019s see an example of the same.<\/p>\n<p>For creating the Audio Manager object, we need to use the getSystemService() method.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">lateinit var my_audio_manager:AudioManager\r\n\/\/creating an instance of the Audio Manager class\r\nmy_audio_manager = getSystemService(Context.AUDIO_SERVICE) as AudioManager\r\n<\/pre>\n<p>Now set the setRingerMode() as follows:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/setting the ringer mode of the device to vibrate\r\nmy_audio_manager.ringerMode = AudioManager.RINGER_MODE_VIBRATE\r\n<\/pre>\n<h3>Android AudioManager Modes<\/h3>\n<p>So, as discussed earlier, you can have several ringing modes for your device. Now for this, you need to use the modes present in Audio Manager.<\/p>\n<p>RINGER_MODE_NORMAL \u2013 It sets the device in its normal state of ringing. When activated, the device will play ringtones and notifications at the volume level set by the user. This is the default mode for most devices and is used when the user wants to hear audible alerts.<\/p>\n<p><strong>RINGER_MODE_VIBRATE<\/strong> \u2013 This mode sets the device to vibrate without playing any sound. The device will vibrate for incoming calls and notifications, making it suitable for environments where loud ringtones might be disruptive. This mode is often used in meetings or quiet places.<\/p>\n<p><strong>RINGER_MODE_SILENT \u2013<\/strong> This mode silences all ringtones and notifications. No sound or vibration is produced, ensuring complete discretion.<\/p>\n<h3>Methods involved in Audio Manager<\/h3>\n<p>Till now, you just got to know about setRingerMode(), but there are more methods present. Let\u2019s see each of them below.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Methods-involved-in-Audio-Manager.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83290\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Methods-involved-in-Audio-Manager.jpg\" alt=\"Methods involved in Audio Manager in Android\" width=\"798\" height=\"722\" \/><\/a><\/p>\n<h4>getRingerMode() \u2013<\/h4>\n<p>It displays the device&#8217;s current ringing mode. It returns one of the three modes: RINGER_MODE_NORMAL, RINGER_MODE_VIBRATE, or RINGER_MODE_SILENT. This helps you understand whether the device will ring, vibrate, or remain silent when there is an incoming call or notification.<\/p>\n<h4>getMode() \u2013<\/h4>\n<p>It tells us the current audio mode of the device, such as MODE_NORMAL, MODE_RINGTONE, MODE_IN_CALL, or MODE_IN_COMMUNICATION. Knowing the audio mode is useful for managing audio settings and behaviours during different scenarios, like phone calls or media playback.<\/p>\n<h4>getStreamVolume(int streamType) \u2013<\/h4>\n<p>This method returns the current volume index for a particular audio stream in your device. For instance, it can give you the current volume level of the media, ringtone, or notification stream. It helps in understanding and adjusting the current audio levels for different types of audio outputs.<\/p>\n<h4>getStreamMaxVolume(int streamtype) \u2013<\/h4>\n<p>This method provides the maximum volume index a particular audio stream can have. This is useful for setting volume levels programmatically, ensuring you don&#8217;t exceed the maximum allowable volume for any stream type.<\/p>\n<h4>adjustVolume(int direction, int flags) \u2013<\/h4>\n<p>You can adjust your device\u2019s volume using this method. The direction parameter can be ADJUST_RAISE, ADJUST_LOWER, or ADJUST_SAME, and the flags parameter can specify additional behaviour, such as showing a volume UI. This allows for dynamic volume control based on user interactions or specific app requirements.<\/p>\n<h4>isMusicActive() \u2013<\/h4>\n<p>It is used to check if your device is playing a piece of music or not. It returns true if music is playing and false otherwise. This is particularly useful for applications that need to manage audio playback or interruptions, ensuring a smooth user experience.<\/p>\n<h3>Android Audio Capture<\/h3>\n<p>As you know about Audio Manager, it\u2019s time for us to explore Android Auto Capture. Android Auto capture is beneficial in terms of communication.<\/p>\n<p>Any android comes with an inbuilt microphone to support calls, conversations, and recording. These all features are possible only due to the Audio capture.<\/p>\n<p>Now to implement the Audio capture, we use the MediaRecorder class. The MediaRecorder class helps us to record both audio as well as video.<\/p>\n<p>To use the MediaRecorder class, you need to use the object of the class. After the object is created successfully, you can specify the source, file format, and output file.<\/p>\n<p>Below is an example that will guide you through the process of implementing Audio Capture.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/creating an object of the Media Recorder class\r\nprivate var my_recording_obj: MediaRecorder = MediaRecorder()\r\n\r\n\/\/setting up the path for our output file\r\nprivate var output: String= Environment.getExternalStorageDirectory().absolutePath + \"\/your_recording.mp3\"\r\n\r\n\/\/setting the various methods of Media Recorder class\r\nmy_recording_obj.setAudioSource(MediaRecorder.AudioSource.MIC)\r\nmy_recording_obj.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)\r\nmy_recording_obj.setAudioEncoder(MediaRecorder.AudioEncoder.AAC)\r\nmy_recording_obj.setOutputFile(output)\r\n\/\/starting the recording using the start() method\r\nmy_recording_obj.start()\r\n<\/pre>\n<h3>Methods involved in Audio Capture<\/h3>\n<p>Similar to Audio Manager, Audio capture also has many methods involved in it. You already saw that the start() method is used to start the recording, but now let\u2019s see some more practical methods.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Methods-of-MediaRecorder-Class.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83291\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Methods-of-MediaRecorder-Class.jpg\" alt=\"Methods of MediaRecorder Class in Android\" width=\"900\" height=\"628\" \/><\/a><\/p>\n<h4>stop() \u2013<\/h4>\n<p>It is used to stop the ongoing recording.<\/p>\n<h4>release() \u2013<\/h4>\n<p>Whenever we need a recorder instance, we use the release() method.<\/p>\n<h4>prepare() \u2013<\/h4>\n<p>It prepares the recorder before the actual recording begins.<\/p>\n<h4>setAudioSource() \u2013<\/h4>\n<p>It sets the source microphone from where the recording will occur.<\/p>\n<h4>setVideoSource() \u2013<\/h4>\n<p>It specifies the source from where the video will be recorded.<\/p>\n<h4>setOutputFormat() \u2013<\/h4>\n<p>It specifies the format we want our audio file to be.<\/p>\n<h4>setAudioEncoder() \u2013<\/h4>\n<p>It sets the encoding format for the audio.<\/p>\n<h4>setOutputFile() \u2013<\/h4>\n<p>It specifies the path where we want our output file to be.<\/p>\n<h3>Implementation of Audio Manager through an App<\/h3>\n<p>So, now let\u2019s see how you can implement AudioManager in your android application. We will develop an app to change your ringing modes and view the current mode. Now, let\u2019s see steps of how you need to build such a kind of application.<\/p>\n<p><strong>1:<\/strong> Open your Android Studio and create a new Project.<\/p>\n<p><strong>2:<\/strong> Select an empty activity and proceed.<\/p>\n<p><strong>3:<\/strong> Provide a name to your application and then select API level 22 and proceed.<\/p>\n<p><strong>4:<\/strong> From Android Marshmallow, you need to give access to do not disturb mode. To this, you need to add the below permission in your manifest file. After you successfully add this permission then only you can change the ringing modes.<\/p>\n<p><strong>Code: AndoridManifest.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    package=\"com.techvidvan.techvidvanaudiomanager\"&gt;\r\n\r\n    &lt;!--    Add the below permission to access the ringing modes--&gt;\r\n    &lt;uses-permission android:name=\"android.permission.ACCESS_NOTIFICATION_POLICY\"\/&gt;\r\n    \r\n    &lt;application\r\n        android:allowBackup=\"true\"\r\n        android:icon=\"@mipmap\/ic_launcher\"\r\n        android:label=\"@string\/app_name\"\r\n        android:roundIcon=\"@mipmap\/ic_launcher_round\"\r\n        android:supportsRtl=\"true\"\r\n        android:theme=\"@style\/Theme.TechVidvanAudioManager\"&gt;\r\n        &lt;activity android:name=\".MainActivity\"&gt;\r\n            &lt;intent-filter&gt;\r\n                &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\r\n\r\n                &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\r\n            &lt;\/intent-filter&gt;\r\n        &lt;\/activity&gt;\r\n    &lt;\/application&gt;\r\n\r\n&lt;\/manifest&gt;\r\n<\/pre>\n<p><strong>Step 5:<\/strong> Now, you need to create four buttons. Three to access the various ringing modes and one to display the current mode. Paste the below code in your activity_main.xml file and then proceed.<\/p>\n<p><strong>Code: activity_main.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;TextView\r\n        android:layout_marginTop=\"50dp\"\r\n        android:id=\"@+id\/title\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"TechVidvan Audio Manager\"\r\n        android:textColor=\"@color\/black\"\r\n        android:textSize=\"30sp\"\r\n        android:gravity=\"center\"\/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/normal_mode\"\r\n        android:onClick=\"setNormalMode\"\r\n        android:layout_marginTop=\"100dp\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"Normal Mode\"\r\n        android:textSize=\"18sp\"\r\n        android:layout_gravity=\"center\"\r\n        android:backgroundTint=\"#4CAF50\"\r\n        \/&gt;\r\n\r\n    &lt;Button\r\n        android:onClick=\"setVibrateMode\"\r\n        android:id=\"@+id\/vibrate_mode\"\r\n        android:layout_marginTop=\"10dp\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"Vibrate Mode\"\r\n        android:textSize=\"18sp\"\r\n        android:layout_gravity=\"center\"\r\n        android:backgroundTint=\"#E91E63\"\r\n        \/&gt;\r\n\r\n    &lt;Button\r\n        android:onClick=\"setSilentMode\"\r\n        android:id=\"@+id\/silent_mode\"\r\n        android:layout_marginTop=\"10dp\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_gravity=\"center\"\r\n        android:text=\"Silent Mode\"\r\n        android:textSize=\"18sp\"\r\n        android:backgroundTint=\"#FF5722\"\r\n        \/&gt;\r\n\r\n\r\n    &lt;Button\r\n        android:onClick=\"viewCurrentMode\"\r\n        android:id=\"@+id\/view_current_mode\"\r\n        android:layout_marginTop=\"80dp\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_gravity=\"center\"\r\n        android:text=\"Check Current Mode\"\r\n        android:textSize=\"18sp\"\r\n        android:backgroundTint=\"#3F51B5\"\r\n        \/&gt;\r\n\r\n&lt;\/LinearLayout&gt;\r\n<\/pre>\n<p><strong>Step 6:<\/strong> Now, go to your MainActivity.kt file and paste the below code there.<\/p>\n<p><strong>Code: MainActivity.kt<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.techvidvan.techvidvanaudiomanager\r\n\r\nimport android.app.NotificationManager\r\nimport android.content.Context\r\nimport android.content.Intent\r\nimport android.media.AudioManager\r\nimport android.os.Build\r\nimport androidx.appcompat.app.AppCompatActivity\r\nimport android.os.Bundle\r\nimport android.provider.Settings\r\nimport android.view.View\r\nimport android.widget.Toast\r\n\r\nclass MainActivity : AppCompatActivity()\r\n{\r\n    \/\/declaring the variables\r\n    lateinit var my_notification_manager:NotificationManager\r\n    lateinit var my_audio_manager:AudioManager\r\n    override fun onCreate(savedInstanceState: Bundle?)\r\n    {\r\n        super.onCreate(savedInstanceState)\r\n        setContentView(R.layout.activity_main)\r\n       \r\n       \/\/creating an object of the notification manager class \r\n       my_notification_manager  = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager\r\n        \r\n        \/\/checking if your android version is Marshmallow or above\r\n        if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M &amp;&amp; !my_notification_manager.isNotificationPolicyAccessGranted)\r\n        {\r\n            \/\/if its marshmallow and above then you need to give the\r\n            \/\/the access of Do not disturb to your application    \r\n            startActivity(Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS))\r\n        }\r\n    \r\n       \/\/creating an instance of the Audio Manager class \r\n       my_audio_manager = getSystemService(Context.AUDIO_SERVICE) as AudioManager\r\n    }\r\n\r\n    \/\/normal mode button listener \r\n    fun setNormalMode(view: View) \r\n    {\r\n        \/\/setting the ringer mode of the device to normal\r\n        my_audio_manager.ringerMode = AudioManager.RINGER_MODE_NORMAL\r\n        Toast.makeText(this@MainActivity, \"Switched to Normal Mode\", Toast.LENGTH_LONG).show()\r\n    }\r\n\r\n    \/\/vibrate mode button listener \r\n    fun setVibrateMode(view: View) \r\n    {\r\n        \/\/setting the ringer mode of the device to vibrate\r\n        my_audio_manager.ringerMode = AudioManager.RINGER_MODE_VIBRATE\r\n        Toast.makeText(this@MainActivity, \"Switched to Vibrate Mode\", Toast.LENGTH_LONG).show()\r\n    }\r\n\r\n    \/\/silent mode button listener \r\n    fun setSilentMode(view: View) \r\n    {\r\n        \/\/setting the ringer mode of the device to silent\r\n        my_audio_manager.ringerMode = AudioManager.RINGER_MODE_SILENT\r\n        Toast.makeText(this@MainActivity, \"Switched to Silent Mode\", Toast.LENGTH_LONG).show()\r\n    }\r\n\r\n    \/\/view current mode button listener \r\n    fun viewCurrentMode(view: View) \r\n    {\r\n        \r\n        \/\/checking the current ringing mode and then toasting it\r\n        when(my_audio_manager.ringerMode) {\r\n            AudioManager.RINGER_MODE_NORMAL -&gt; {\r\n                Toast.makeText(this@MainActivity, \"Current Mode is Normal Mode\", Toast.LENGTH_LONG)\r\n                    .show()\r\n            }\r\n\r\n            AudioManager.RINGER_MODE_VIBRATE -&gt; {\r\n                Toast.makeText(this@MainActivity, \"Current Mode is Vibrate Mode\", Toast.LENGTH_LONG)\r\n                    .show()\r\n            }\r\n\r\n            AudioManager.RINGER_MODE_SILENT -&gt; {\r\n                Toast.makeText(this@MainActivity, \"Current Mode is Silent Mode\", Toast.LENGTH_LONG)\r\n                    .show()\r\n            }\r\n        }\r\n\r\n    }\r\n}\r\n<\/pre>\n<p>So, after you are done with the above steps, simply run your application and notice the following as output.<\/p>\n<p>First, since my android version is above Marshmallow, I need to allow the Do Not Disturb mode in my application.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_1-5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83293\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_1-5.jpg\" alt=\"Android Audio Manager\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p>Now open your application again.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_2-5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83294\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_2-5.jpg\" alt=\"Android AudioManager\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p>Next, check your current mode.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_3-5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83295\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_3-5.jpg\" alt=\"Android Current Mode\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p>Now test switching between the three different modes and check if they are working.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_4-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83296\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_4-1.jpg\" alt=\"Switching Mode in Android\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83297\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_5.jpg\" alt=\"Switching Mode in Android\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83299\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_6.jpg\" alt=\"Switching Mode in Android\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>So through this article, I hope you got to know what an AudioManager is and its purpose in Android. You saw the several ringing modes and also the various methods involved.<\/p>\n<p>Later on, you came across the Audio capture in Android, which I used to record your voice and communicate with others. Finally, you saw an implementation of the Audio Manager through an android application.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most often, whenever we get calls or messages, then our device plays a ringtone. Did you ever think about how these work? These all are handled through the Android AudioManager. The Audio Manager helps&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":83288,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2791],"tags":[3932,3933,3934,3935],"class_list":["post-83195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-audio-capture","tag-android-audio-capture-methods","tag-android-audiomanager-modes","tag-audiomanager-in-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AudioManager in Android with Examples - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn about AudioManager and its purpose in Android with its implementation. See the several ringing modes and the various methods involved.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AudioManager in Android with Examples - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn about AudioManager and its purpose in Android with its implementation. See the several ringing modes and the various methods involved.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-02T03:30:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-04T15:32:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android_Audio_Manager.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AudioManager in Android with Examples - TechVidvan","description":"Learn about AudioManager and its purpose in Android with its implementation. See the several ringing modes and the various methods involved.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/","og_locale":"en_US","og_type":"article","og_title":"AudioManager in Android with Examples - TechVidvan","og_description":"Learn about AudioManager and its purpose in Android with its implementation. See the several ringing modes and the various methods involved.","og_url":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-08-02T03:30:32+00:00","article_modified_time":"2024-08-04T15:32:39+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android_Audio_Manager.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"AudioManager in Android with Examples","datePublished":"2021-08-02T03:30:32+00:00","dateModified":"2024-08-04T15:32:39+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/"},"wordCount":1202,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android_Audio_Manager.jpg","keywords":["Android Audio Capture","Android Audio Capture methods","Android AudioManager Modes","AudioManager in Android"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/","url":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/","name":"AudioManager in Android with Examples - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android_Audio_Manager.jpg","datePublished":"2021-08-02T03:30:32+00:00","dateModified":"2024-08-04T15:32:39+00:00","description":"Learn about AudioManager and its purpose in Android with its implementation. See the several ringing modes and the various methods involved.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android_Audio_Manager.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/Android_Audio_Manager.jpg","width":1200,"height":628,"caption":"AudioManager in Android"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/android-audio-manager\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"AudioManager in Android with Examples"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=83195"}],"version-history":[{"count":2,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83195\/revisions"}],"predecessor-version":[{"id":447585,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83195\/revisions\/447585"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/83288"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=83195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=83195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=83195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}