APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.media.sound

pack-priv Class StandardFileFormat

extends AudioFileFormat
Class Inheritance
Known Direct Subclasses
com.sun.media.sound.WaveFileFormat, com.sun.media.sound.AiffFileFormat, com.sun.media.sound.AuFileFormat
Imports
javax.sound.sampled.AudioFileFormat, .AudioFormat, .AudioSystem

An instance of the StandardFileFormat describes the file's length in bytes and the length in sample frames as longs. This will provide an additional precision unlike the AudioFileFormat.

Field Summary

Modifier and TypeField and Description
private final long
byteLength

Hides javax.sound.sampled.AudioFileFormat.byteLength.

File length in bytes stored as long.
private final long
frameLength

Hides javax.sound.sampled.AudioFileFormat.frameLength.

Audio data length in sample frames stored as long.

Constructor Summary

AccessConstructor and Description
pack-priv
StandardFileFormat(final AudioFileFormat.Type
the type of the audio file
type
,
final AudioFormat
the format of the audio data contained in the file
format
,
final long
the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED
frameLength
)

Constructs StandardFileFormat object.

pack-priv
StandardFileFormat(final AudioFileFormat.Type
the type of the audio file
type
,
final long
the length of the file in bytes, or AudioSystem.NOT_SPECIFIED
byteLength
,
final AudioFormat
the format of the audio data contained in the file
format
,
final long
the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED
frameLength
)

Constructs StandardFileFormat object.

Method Summary

Modifier and TypeMethod and Description
private static int

Returns:

the clipped value
clip
(final long
which should be clipped
value
)

Replaces the passed value to AudioSystem.NOT_SPECIFIED if the value is greater than Integer.MAX_VALUE.

public final long

Returns:

the audio file length in bytes
getLongByteLength
()

Obtains the size in bytes of the entire audio file (not just its audio data).

public final long

Returns:

the number of sample frames of audio data in the file
getLongFrameLength
()

Obtains the length of the audio data contained in the file, expressed in sample frames.

Inherited from javax.sound.sampled.AudioFileFormat:
getByteLengthgetFormatgetFrameLengthgetPropertygetTypepropertiestoString

Field Detail

byteLengthback to summary
private final long byteLength

Hides javax.sound.sampled.AudioFileFormat.byteLength.

File length in bytes stored as long.

frameLengthback to summary
private final long frameLength

Hides javax.sound.sampled.AudioFileFormat.frameLength.

Audio data length in sample frames stored as long.

Constructor Detail

StandardFileFormatback to summary
pack-priv StandardFileFormat(final AudioFileFormat.Type type, final AudioFormat format, final long frameLength)

Constructs StandardFileFormat object.

Parameters
type:AudioFileFormat.Type

the type of the audio file

format:AudioFormat

the format of the audio data contained in the file

frameLength:long

the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED

StandardFileFormatback to summary
pack-priv StandardFileFormat(final AudioFileFormat.Type type, final long byteLength, final AudioFormat format, final long frameLength)

Constructs StandardFileFormat object.

Parameters
type:AudioFileFormat.Type

the type of the audio file

byteLength:long

the length of the file in bytes, or AudioSystem.NOT_SPECIFIED

format:AudioFormat

the format of the audio data contained in the file

frameLength:long

the audio data length in sample frames, or AudioSystem.NOT_SPECIFIED

Method Detail

clipback to summary
private static int clip(final long value)

Replaces the passed value to AudioSystem.NOT_SPECIFIED if the value is greater than Integer.MAX_VALUE.

Parameters
value:long

which should be clipped

Returns:int

the clipped value

getLongByteLengthback to summary
public final long getLongByteLength()

Obtains the size in bytes of the entire audio file (not just its audio data). The long precision is used.

Returns:long

the audio file length in bytes

See Also
AudioSystem#NOT_SPECIFIED
getLongFrameLengthback to summary
public final long getLongFrameLength()

Obtains the length of the audio data contained in the file, expressed in sample frames. The long precision is used.

Returns:long

the number of sample frames of audio data in the file

See Also
AudioSystem#NOT_SPECIFIED