Stay organized with collections
Save and categorize content based on your preferences.
public
final
class
MediaRecorder.AudioEncoder
extends Object
Defines the audio encoding. These constants are used with
MediaRecorder.setAudioEncoder(int)
.
Summary
Constants |
int |
AAC
AAC Low Complexity (AAC-LC) audio codec
|
int |
AAC_ELD
Enhanced Low Delay AAC (AAC-ELD) audio codec
|
int |
AMR_NB
AMR (Narrowband) audio codec
|
int |
AMR_WB
AMR (Wideband) audio codec
|
int |
DEFAULT
|
int |
HE_AAC
High Efficiency AAC (HE-AAC) audio codec
|
int |
OPUS
Opus audio codec
|
int |
VORBIS
Ogg Vorbis audio codec (Support is optional)
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Constants
AAC
public static final int AAC
AAC Low Complexity (AAC-LC) audio codec
Constant Value:
3
(0x00000003)
AAC_ELD
public static final int AAC_ELD
Enhanced Low Delay AAC (AAC-ELD) audio codec
Constant Value:
5
(0x00000005)
AMR_NB
public static final int AMR_NB
AMR (Narrowband) audio codec
Constant Value:
1
(0x00000001)
AMR_WB
public static final int AMR_WB
AMR (Wideband) audio codec
Constant Value:
2
(0x00000002)
DEFAULT
public static final int DEFAULT
Constant Value:
0
(0x00000000)
HE_AAC
public static final int HE_AAC
High Efficiency AAC (HE-AAC) audio codec
Constant Value:
4
(0x00000004)
OPUS
public static final int OPUS
Opus audio codec
Constant Value:
7
(0x00000007)
VORBIS
public static final int VORBIS
Ogg Vorbis audio codec (Support is optional)
Constant Value:
6
(0x00000006)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaRecorder.AudioEncoder\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Inherited Methods](#inhmethods) \n\nMediaRecorder.AudioEncoder\n==========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/MediaRecorder.AudioEncoder \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\nfinal\n\nclass\nMediaRecorder.AudioEncoder\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.media.MediaRecorder.AudioEncoder |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nDefines the audio encoding. These constants are used with\n[MediaRecorder.setAudioEncoder(int)](/reference/android/media/MediaRecorder#setAudioEncoder(int)).\n\nSummary\n-------\n\n| ### Constants ||\n|-------|---------------------------------------------------------------------------------------------------------------------|\n| `int` | [AAC](/reference/android/media/MediaRecorder.AudioEncoder#AAC) AAC Low Complexity (AAC-LC) audio codec |\n| `int` | [AAC_ELD](/reference/android/media/MediaRecorder.AudioEncoder#AAC_ELD) Enhanced Low Delay AAC (AAC-ELD) audio codec |\n| `int` | [AMR_NB](/reference/android/media/MediaRecorder.AudioEncoder#AMR_NB) AMR (Narrowband) audio codec |\n| `int` | [AMR_WB](/reference/android/media/MediaRecorder.AudioEncoder#AMR_WB) AMR (Wideband) audio codec |\n| `int` | [DEFAULT](/reference/android/media/MediaRecorder.AudioEncoder#DEFAULT) |\n| `int` | [HE_AAC](/reference/android/media/MediaRecorder.AudioEncoder#HE_AAC) High Efficiency AAC (HE-AAC) audio codec |\n| `int` | [OPUS](/reference/android/media/MediaRecorder.AudioEncoder#OPUS) Opus audio codec |\n| `int` | [VORBIS](/reference/android/media/MediaRecorder.AudioEncoder#VORBIS) Ogg Vorbis audio codec (Support is optional) |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nConstants\n---------\n\n### AAC\n\nAdded in [API level 10](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int AAC\n```\n\nAAC Low Complexity (AAC-LC) audio codec\n\n\u003cbr /\u003e\n\nConstant Value:\n\n3\n(0x00000003)\n\n\n### AAC_ELD\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int AAC_ELD\n```\n\nEnhanced Low Delay AAC (AAC-ELD) audio codec\n\n\u003cbr /\u003e\n\nConstant Value:\n\n5\n(0x00000005)\n\n\n### AMR_NB\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int AMR_NB\n```\n\nAMR (Narrowband) audio codec\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### AMR_WB\n\nAdded in [API level 10](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int AMR_WB\n```\n\nAMR (Wideband) audio codec\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### DEFAULT\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int DEFAULT\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### HE_AAC\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int HE_AAC\n```\n\nHigh Efficiency AAC (HE-AAC) audio codec\n\n\u003cbr /\u003e\n\nConstant Value:\n\n4\n(0x00000004)\n\n\n### OPUS\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int OPUS\n```\n\nOpus audio codec\n\n\u003cbr /\u003e\n\nConstant Value:\n\n7\n(0x00000007)\n\n\n### VORBIS\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int VORBIS\n```\n\nOgg Vorbis audio codec (Support is optional)\n\n\u003cbr /\u003e\n\nConstant Value:\n\n6\n(0x00000006)"]]