Mp3Audio
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.editor.htmlcss.resources.IHtmlResource
public final class Mp3Audio implements IHtmlResource
Represents one audio resource of arbitrary format
| Constructor | Description |
|---|---|
| Mp3Audio(String name, System.IO.Stream binaryContent, boolean leaveOpen) | Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name |
| Method | Description |
|---|---|
| isValid(System.IO.Stream binaryContent) | Checks whether specified stream is a valid MP3 content |
| getName() | Returns name of this MP3 content. |
| getFilenameWithExtension() | Returns correct filename of this MP3 content, which consists of name and extension. |
| getType() | Returns a AudioFormat.Mp3 (also satisfies IHtmlResource.getFormat() via covariant return) |
| getByteContent() | Returns content of this font as byte stream |
| getByteContentInternal() | Returns content of this MP3 audio resource as byte stream with original position |
| getTextContent() | Returns content of this MP3 resource as base64-encoded string. |
| save(String fullPathToFile) | Saves this MP3 resource to the specified file |
| equals(IHtmlResource other) | Checks this instance with specified HTML resource on reference equality |
| equals(Mp3Audio other) | Checks this instance with specified font resource on reference equality |
| dispose() | Disposes this MP3 resource, disposing its content and making most methods and properties non-working |
| isDisposed() | Determines whether this MP3 content is disposed or not |
| addDisposedListener(EventHandler value) | |
| removeDisposedListener(EventHandler value) |
public Mp3Audio(String name, System.IO.Stream binaryContent, boolean leaveOpen)
Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | Name of the MP3 content. Cannot be null, empty or whitespaces. |
| binaryContent | com.aspose.ms.System.IO.Stream | 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 | boolean | Determines whether or not dispose specified stream when Mp3Audio instance is disposed |
public static boolean isValid(System.IO.Stream binaryContent)
Checks whether specified stream is a valid MP3 content
Parameters:
| Parameter | Type | Description |
|---|---|---|
| binaryContent | com.aspose.ms.System.IO.Stream | Byte stream, that presumably contains a MP3 content |
Returns: boolean - True if specified stream contains valid MP3 content, false otherwise
public String getName()
Returns name of this MP3 content. Usually doesn’t contain filename extension and theoretically can differ from filename.
Returns: java.lang.String
public String getFilenameWithExtension()
Returns correct filename of this MP3 content, which consists of name and extension. Theoretically can differ from the name.
Returns: java.lang.String
public AudioType getType()
Returns a AudioFormat.Mp3 (also satisfies IHtmlResource.getFormat() via covariant return)
Returns: AudioType
public InputStream getByteContent()
Returns content of this font as byte stream
Returns: java.io.InputStream
public System.IO.Stream getByteContentInternal()
Returns content of this MP3 audio resource as byte stream with original position
Returns: com.aspose.ms.System.IO.Stream
public String getTextContent()
Returns content of this MP3 resource as base64-encoded string. This value is cached after first invoke.
Returns: java.lang.String
public void save(String fullPathToFile)
Saves this MP3 resource to the specified file
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullPathToFile | java.lang.String | Full path to the file, which will be created or rewritten |
public boolean equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IHtmlResource | Other inheritor of IHtmlResource interface |
Returns: boolean - True if are equal, false if are unequal
public boolean equals(Mp3Audio other)
Checks this instance with specified font resource on reference equality
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | Mp3Audio | Other instance of Mp3Audio class |
Returns: boolean - True if are equal, false if are unequal
public void dispose()
Disposes this MP3 resource, disposing its content and making most methods and properties non-working
public boolean isDisposed()
Determines whether this MP3 content is disposed or not
Returns: boolean
public void addDisposedListener(EventHandler value)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | EventHandler |
public void removeDisposedListener(EventHandler value)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | EventHandler |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.