AacMuxer
@UnstableApi
public final class AacMuxer implements Muxer
A muxer for creating an AAC (Advanced Audio Coding) container file.
This muxer supports muxing of AAC audio codec.
Summary
Public constructors |
|---|
AacMuxer(FileOutputStream outputStream)Creates an |
Public methods |
|
|---|---|
void |
addMetadataEntry(Metadata.Entry metadataEntry)Adds metadata about the output file. |
int |
Add an |
void |
close()Closes the file. |
void |
writeSampleData(Writes encoded sample data. |
Inherited methods |
||
|---|---|---|
|
Public constructors
AacMuxer
public AacMuxer(FileOutputStream outputStream)
Creates an AacMuxer instance.
| Parameters | |
|---|---|
FileOutputStream outputStream |
The |
Public methods
addMetadataEntry
public void addMetadataEntry(Metadata.Entry metadataEntry)
Adds metadata about the output file.
This operation is not supported for AAC muxing and will always throw an UnsupportedOperationException.
addTrack
public int addTrack(Format format)
Add an AAC audio track.
| Returns | |
|---|---|
int |
A track id for this track, which should be passed to |
close
public void close()
Closes the file.
The muxer cannot be used anymore once this method returns.
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer fails to finish writing the output. |
writeSampleData
public void writeSampleData(
int trackId,
ByteBuffer byteBuffer,
BufferInfo bufferInfo
)
Writes encoded sample data.
| Parameters | |
|---|---|
int trackId |
The track id, previously returned by |
ByteBuffer byteBuffer |
A buffer containing the sample data to write to the container. |
BufferInfo bufferInfo |
The |
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer fails to write the sample. |