Package ca.phon.media
Class LongSound
java.lang.Object
ca.phon.media.LongSound
- All Implemented Interfaces:
IExtendable
- Direct Known Subclasses:
AudioFileLongSound
LongSound objects allow for access to audio stream information
without loading the entire audio file into memory. Segments may
be extracted from the LongSound for analysis.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
abstract Sound
extractPart
(float startTime, float endTime) Extract portion of sound for analysis.static LongSound
fromFile
(File file, VolumeModel volumeModel) <T> T
getExtension
(Class<T> cap) Get the requested extension if available.Return all extension types supportedgetFile()
abstract Sampled
As sampledabstract float
length()
Length of audio in secondsabstract int
Number of channels in audio file.<T> T
putExtension
(Class<T> cap, T impl) Add a new extension.<T> T
removeExtension
(Class<T> cap) Remove a capability.
-
Field Details
-
PREFERRED_LONGSOUND_LOADER_PROP
-
-
Constructor Details
-
LongSound
-
-
Method Details
-
fromFile
- Throws:
IOException
-
getFile
-
close
- Throws:
IOException
-
numberOfChannels
public abstract int numberOfChannels()Number of channels in audio file.- Returns:
- number of channels
-
length
public abstract float length()Length of audio in seconds- Returns:
-
getSampled
As sampled- Returns:
- return long sound data as a sampled object
-
extractPart
Extract portion of sound for analysis.- Parameters:
startTime
-endTime
-- Returns:
- sound segment
-
getExtensions
Description copied from interface:IExtendable
Return all extension types supported- Specified by:
getExtensions
in interfaceIExtendable
-
getExtension
Description copied from interface:IExtendable
Get the requested extension if available.- Specified by:
getExtension
in interfaceIExtendable
- Returns:
- the capability object or
null
if the cability is not available
-
putExtension
Description copied from interface:IExtendable
Add a new extension.- Specified by:
putExtension
in interfaceIExtendable
- Parameters:
cap
- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendable
Remove a capability.- Specified by:
removeExtension
in interfaceIExtendable
- Parameters:
cap
- the capability to remove
-