public final class Mp3Audio extends Object implements IHtmlResource
Represents one audio resource of arbitrary format
| Constructor and Description |
|---|
Mp3Audio(String name,
com.aspose.ms.System.IO.Stream binaryContent,
boolean leaveOpen)
Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDisposedListener(EventHandler value) |
void |
dispose()
Disposes this MP3 resource, disposing its content and making most methods and properties non-working
|
boolean |
equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
|
boolean |
equals(Mp3Audio other)
Checks this instance with specified font resource on reference equality
|
InputStream |
getByteContent()
Returns content of this font as byte stream
|
com.aspose.ms.System.IO.Stream |
getByteContentInternal()
Returns content of this MP3 audio resource as byte stream with original position
|
String |
getFilenameWithExtension()
Returns correct filename of this MP3 content, which consists of name and extension.
|
String |
getName()
Returns name of this MP3 content.
|
String |
getTextContent()
Returns content of this MP3 resource as base64-encoded string.
|
AudioType |
getType()
Returns a AudioFormat.Mp3 (also satisfies IHtmlResource.getFormat() via covariant return)
|
boolean |
isDisposed()
Determines whether this MP3 content is disposed or not
|
static boolean |
isValid(com.aspose.ms.System.IO.Stream binaryContent)
Checks whether specified stream is a valid MP3 content
|
void |
removeDisposedListener(EventHandler value) |
void |
save(String fullPathToFile)
Saves this MP3 resource to the specified file
|
public Mp3Audio(String name, com.aspose.ms.System.IO.Stream binaryContent, boolean leaveOpen)
Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name
name - Name of the MP3 content. Cannot be null, empty or whitespaces.binaryContent - Content as byte stream. Reading begins from original position. Cannot be
null. Should be readable and seekable. If this instance will be disposed, this stream will be
disposed too.leaveOpen - Determines whether or not dispose specified stream when Mp3Audio instance is disposedcom.aspose.ms.System.ArgumentExceptionpublic void addDisposedListener(EventHandler value)
public void dispose()
Disposes this MP3 resource, disposing its content and making most methods and properties non-working
dispose in interface IDisposablepublic boolean equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
other - Other inheritor of IHtmlResource interfacepublic boolean equals(Mp3Audio other)
Checks this instance with specified font resource on reference equality
other - Other instance of Mp3Audio classpublic InputStream getByteContent()
Returns content of this font as byte stream
getByteContent in interface IHtmlResourcepublic com.aspose.ms.System.IO.Stream getByteContentInternal()
Returns content of this MP3 audio resource as byte stream with original position
getByteContentInternal in interface IHtmlResourcepublic String getFilenameWithExtension()
Returns correct filename of this MP3 content, which consists of name and extension. Theoretically can differ from the name.
getFilenameWithExtension in interface IHtmlResourcepublic String getName()
Returns name of this MP3 content. Usually doesn't contain filename extension and theoretically can differ from filename.
getName in interface IHtmlResourcepublic String getTextContent()
Returns content of this MP3 resource as base64-encoded string. This value is cached after first invoke.
getTextContent in interface IHtmlResourcepublic AudioType getType()
Returns a AudioFormat.Mp3 (also satisfies IHtmlResource.getFormat() via covariant return)
getType in interface IHtmlResourcepublic boolean isDisposed()
Determines whether this MP3 content is disposed or not
isDisposed in interface IAuxDisposablepublic static boolean isValid(com.aspose.ms.System.IO.Stream binaryContent)
Checks whether specified stream is a valid MP3 content
binaryContent - Byte stream, that presumably contains a MP3 contentpublic void removeDisposedListener(EventHandler value)
public void save(String fullPathToFile)
Saves this MP3 resource to the specified file
save in interface IHtmlResourcefullPathToFile - Full path to the file, which will be created or rewrittenCopyright © 2026. All rights reserved.