Mp3Audio

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

Constructors

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

Methods

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)

Mp3Audio(String name, System.IO.Stream binaryContent, boolean leaveOpen)

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

isValid(System.IO.Stream binaryContent)

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

getName()

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

getFilenameWithExtension()

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

getType()

public AudioType getType()

Returns a AudioFormat.Mp3 (also satisfies IHtmlResource.getFormat() via covariant return)

Returns: AudioType

getByteContent()

public InputStream getByteContent()

Returns content of this font as byte stream

Returns: java.io.InputStream

getByteContentInternal()

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

getTextContent()

public String getTextContent()

Returns content of this MP3 resource as base64-encoded string. This value is cached after first invoke.

Returns: java.lang.String

save(String fullPathToFile)

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

equals(IHtmlResource other)

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

equals(Mp3Audio other)

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

dispose()

public void dispose()

Disposes this MP3 resource, disposing its content and making most methods and properties non-working

isDisposed()

public boolean isDisposed()

Determines whether this MP3 content is disposed or not

Returns: boolean

addDisposedListener(EventHandler value)

public void addDisposedListener(EventHandler value)

Parameters:

Parameter Type Description
value EventHandler

removeDisposedListener(EventHandler value)

public void removeDisposedListener(EventHandler value)

Parameters:

Parameter Type Description
value EventHandler