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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()abstract SoundextractPart(float startTime, float endTime) Extract portion of sound for analysis.static LongSoundfromFile(File file, VolumeModel volumeModel) <T> TgetExtension(Class<T> cap) Get the requested extension if available.Return all extension types supportedgetFile()abstract SampledAs sampledabstract floatlength()Length of audio in secondsabstract intNumber of channels in audio file.<T> TputExtension(Class<T> cap, T impl) Add a new extension.<T> TremoveExtension(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
-
extractPart
Extract portion of sound for analysis.- Parameters:
startTime-endTime-- Returns:
- sound segment
-
getExtensions
Description copied from interface:IExtendableReturn all extension types supported- Specified by:
getExtensionsin interfaceIExtendable
-
getExtension
Description copied from interface:IExtendableGet the requested extension if available.- Specified by:
getExtensionin interfaceIExtendable- Returns:
- the capability object or
nullif the cability is not available
-
putExtension
Description copied from interface:IExtendableAdd a new extension.- Specified by:
putExtensionin interfaceIExtendable- Parameters:
cap- the extension to add- Returns:
- the added extension implementation
-
removeExtension
Description copied from interface:IExtendableRemove a capability.- Specified by:
removeExtensionin interfaceIExtendable- Parameters:
cap- the capability to remove
-