cami.jmootcher
Class JMootcher.SoundFile

java.lang.Object
  extended by cami.jmootcher.JMootcher.SoundFile
All Implemented Interfaces:
JMootcherConstants
Enclosing class:
JMootcher

public class JMootcher.SoundFile
extends java.lang.Object
implements JMootcherConstants

An inner class, representating a freesound-sample

Author:
Camillo Bruni

Field Summary
 
Fields inherited from interface cami.jmootcher.JMootcherConstants
AIFF, BUFFER_SIZE, FILE_URL, FLAC, HOME_URL, LOGIN_URL, MP3, OGG, SAMPLE_DATE_FORMAT, WAV, XML_SEARCH_URL, XML_SIMILAR_URL, XML_URL
 
Constructor Summary
JMootcher.SoundFile(JMootcher mootcher, int ID)
           
JMootcher.SoundFile(JMootcher mootcher, java.lang.String ID)
           
 
Method Summary
 javax.sound.sampled.Clip getAudioClip()
           
 int getBitDepth()
          returns the bitDepth of the sample, usually 16
 int getBitRate()
          returns the resolution of the sample
 int getChannels()
          returns the number of channels, usually 1 or 2
 java.util.Date getDate()
          returns the creation-date of this sample
 java.lang.String getDescription()
          returns the freesound description of this file
 JMootcher.SoundFile[] getDissimilarFiles()
          returns an array containig disimilar soundfiles, for further information see
 float getDuration()
          returns the duration in seconds of the sample
 java.lang.String getExtension()
          returns the fileextension
 int getFileSize()
          returns the filesize in bytes
 int getFileType()
          Returns an internal representation of the soundTypes
 java.net.URL getFileURL()
           
 int getID()
          Returns the freesound id of this sample
 java.io.InputStream getInputStream()
          returns an InputStream pointing to the given file, or null if the File doesnt exist, the InputStream points on the web
 java.lang.String[] getKeyWords()
          returns the freesound keywords for this sample
 float getLatitude()
          Returns the altitude of a geotagged Sample, null if not geotagged
 float getLongitude()
          return the logitude of geotagged sample, or null
 JMootcher getMootcher()
          returns the assigned jMootcher controller, which handles all HTTP-requests
 java.lang.String getOriginalFileName()
          returns the sample's original filename
 java.io.File getPreview()
           
 java.net.URL getPreviewImageURL()
          returns the URL of a preview image, frequency is colorcoded, imageFormat is png
 java.lang.String getPreviewImageURLString()
           
 java.io.InputStream getPreviewInputStream()
          returns an InputStream pointing to the preview mp3, if the File doesnt exists a null is returned
 java.net.URL getPreviewURL()
          returns the URL to the prewiev soundFile, which is accessiblel without an account, for the full sample a freesound account is required.
 java.lang.String getPreviewURLString()
           
 java.io.File getSample()
           
 int getSampleRate()
          returns the sample rate in [Hz]
 JMootcher.SoundFile[] getSimilarFiles()
          returns an array containig similar soundfiles, for further information see
 int getUserID()
          returns the user-id of the creater of this sample
 boolean isGeoTagged()
          returns if the sample has been geotagge ( an altidude and logitude assigned)
 void loop(int numberOfLoops)
           
 void play()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMootcher.SoundFile

public JMootcher.SoundFile(JMootcher mootcher,
                           java.lang.String ID)
                    throws java.lang.Exception
Throws:
java.lang.Exception

JMootcher.SoundFile

public JMootcher.SoundFile(JMootcher mootcher,
                           int ID)
                    throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getID

public int getID()
Returns the freesound id of this sample


getFileType

public int getFileType()
Returns an internal representation of the soundTypes

Returns:
fileType_
See Also:
JMootcherConstants

getLatitude

public float getLatitude()
Returns the altitude of a geotagged Sample, null if not geotagged

Returns:
See Also:
getLongitude, isGeoTagged

getLongitude

public float getLongitude()
return the logitude of geotagged sample, or null

Returns:
See Also:
getAltitude, isGeoTagged

isGeoTagged

public boolean isGeoTagged()
returns if the sample has been geotagge ( an altidude and logitude assigned)

Returns:
See Also:
getAltitude, getLongitude

getBitDepth

public int getBitDepth()
returns the bitDepth of the sample, usually 16

Returns:

getBitRate

public int getBitRate()
returns the resolution of the sample

Returns:

getChannels

public int getChannels()
returns the number of channels, usually 1 or 2

Returns:

getDescription

public java.lang.String getDescription()
returns the freesound description of this file

Returns:

getDuration

public float getDuration()
returns the duration in seconds of the sample

Returns:

getExtension

public java.lang.String getExtension()
returns the fileextension

Returns:
See Also:
getFileType

getFileSize

public int getFileSize()
returns the filesize in bytes

Returns:

getFileURL

public java.net.URL getFileURL()

getKeyWords

public java.lang.String[] getKeyWords()
returns the freesound keywords for this sample

Returns:

getDate

public java.util.Date getDate()
returns the creation-date of this sample

Returns:

getMootcher

public JMootcher getMootcher()
returns the assigned jMootcher controller, which handles all HTTP-requests

Returns:

getOriginalFileName

public java.lang.String getOriginalFileName()
returns the sample's original filename

Returns:

getPreviewURL

public java.net.URL getPreviewURL()
returns the URL to the prewiev soundFile, which is accessiblel without an account, for the full sample a freesound account is required.

Returns:

getPreviewURLString

public java.lang.String getPreviewURLString()

getPreviewImageURL

public java.net.URL getPreviewImageURL()
returns the URL of a preview image, frequency is colorcoded, imageFormat is png

Returns:

getPreviewImageURLString

public java.lang.String getPreviewImageURLString()

getSampleRate

public int getSampleRate()
returns the sample rate in [Hz]

Returns:
sampleRate

getUserID

public int getUserID()
returns the user-id of the creater of this sample

Returns:

getSimilarFiles

public JMootcher.SoundFile[] getSimilarFiles()
returns an array containig similar soundfiles, for further information see

Returns:
See Also:
getDissimilarFiles

getDissimilarFiles

public JMootcher.SoundFile[] getDissimilarFiles()
returns an array containig disimilar soundfiles, for further information see

Returns:
See Also:
getSimilarFiles

getInputStream

public java.io.InputStream getInputStream()
returns an InputStream pointing to the given file, or null if the File doesnt exist, the InputStream points on the web

Returns:

getPreviewInputStream

public java.io.InputStream getPreviewInputStream()
returns an InputStream pointing to the preview mp3, if the File doesnt exists a null is returned

Returns:

getSample

public java.io.File getSample()

getPreview

public java.io.File getPreview()

play

public void play()

loop

public void loop(int numberOfLoops)

stop

public void stop()

getAudioClip

public javax.sound.sampled.Clip getAudioClip()