vxp
Class SoundSource

java.lang.Object
  extended byjava.lang.Thread
      extended byvxp.SoundSource
All Implemented Interfaces:
java.lang.Runnable, quicktime.sound.SoundConstants

public class SoundSource
extends java.lang.Thread
implements quicktime.sound.SoundConstants

Author:
DanO

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface quicktime.sound.SoundConstants
ampCmd, availableCmd, bufferCmd, callBackCmd, clockComponentCmd, cmpSH, continueCmd, dataOffsetFlag, dbBufferReady, dbLastBuffer, doubleBufferCmd, eightToThree, extSH, firstSoundFormat, fixedCompression, flushCmd, freeCmd, freqCmd, freqDurationCmd, gestalt16BitAudioSupport, gestalt16BitSoundIO, gestaltBuiltInSoundInput, gestaltHasSoundInputDevice, gestaltLineLevelInput, gestaltMultiChannels, gestaltPlayAndRecord, gestaltSndPlayDoubleBuffer, gestaltSoundAttr, gestaltSoundIOMgrPresent, gestaltStereoCapability, gestaltStereoInput, gestaltStereoMixing, getAmpCmd, getClockComponentCmd, getRateCmd, getRateMultiplierCmd, getVolumeCmd, initChanLeft, initChanRight, initCmd, initCompMask, initMACE3, initMACE6, initMono, initNoDrop, initNoInterp, initPanMask, initSRateMask, initStereo, initStereoMask, k16BitBigEndianFormat, k16BitIn, k16BitLittleEndianFormat, k16BitOut, k24BitFormat, k32BitFormat, k32BitLittleEndianFormat, k8BitOffsetBinaryFormat, k8BitRawIn, k8BitRawOut, k8BitTwosIn, k8BitTwosOut, kActionMask, kALawCompression, kAudioEndianAtomType, kAudioFormatAtomType, kAudioTerminatorAtomType, kAudioVBRAtomType, kBestQuality, kCDSource, kCDXA2Compression, kCDXA4Compression, kCreateSoundSource, kDAVInSource, kDVAudioFormat, kDVDSource, kDVIIntelIMAFormat, kExtendedSoundBufferSizeValid, kExtendedSoundData, kExtendedSoundSampleCountNotValid, kExtMicSource, kFloat32Format, kFloat64Format, kFullMPEGLay3Format, kFullVolume, kHighQuality, kIMACompression, kInputMask, kIntMicSource, kInvalidSource, kLittleEndianFormat, kMACE3Compression, kMACE6Compression, kMediaBaySource, kMicrophoneArray, kMicrosoftADPCMFormat, kMiddleC, kModemSource, kMPEGLayer3Format, kNoChannelConversion, kNoDecompression, kNoMixing, kNonInterleavedBuffer, kNonPagingMixer, kNonRealTime, kNoRealtimeProcessing, kNoSampleFormatConversion, kNoSampleRateConversion, kNoSampleSizeConversion, kNoSoundComponentChain, kNoSource, kNoVolume, kNoVolumeConversion, kOffsetBinary, kOutputMask, kOutputShift, kPagingMixer, kPassThrough, kPCCardSource, kRateConvert, kRCAInSource, kReverse, kScheduledSoundDoCallBack, kScheduledSoundDoScheduled, kScheduledSoundExtendedHdr, kScheduledSource, kSimpleBeepID, kSoundComponentBits, kSoundConverterDidntFillBuffer, kSoundConverterHasLeftOverData, kSoundConverterMixer, kSoundInSource, kSoundNotCompressed, kSourcePaused, kStereoIn, kStereoOut, kTVFMTunerSource, kTwosComplement, kULawCompression, kUseOptionalOutputDevice, kVMAwareMixer, kVMAwareness, kZoomVideoSource, leftOverBlockSize, linkSoundComponentsCmd, loadCmd, MACE3snthID, MACE6snthID, notCompressed, nullCmd, pauseCmd, phaseCmd, quietCmd, rate11025hz, rate11khz, rate16khz, rate22050hz, rate22khz, rate32khz, rate44khz, rate48khz, rate8khz, rateCmd, rateMultiplierCmd, reInitCmd, restCmd, resumeCmd, sampledSynth, scheduledSoundCmd, secondSoundFormat, siActiveChannels, siActiveLevels, siAGCOnOff, siAsync, siAVDisplayBehavior, siBestQuality, siBetterQuality, siCDQuality, siChannelAvailable, siCompressionAvailable, siCompressionChannels, siCompressionFactor, siCompressionHeader, siCompressionNames, siCompressionParams, siCompressionSampleRate, siCompressionType, siContinuous, siDecompressionParams, siDeviceBufferInfo, siDeviceConnected, siDeviceIcon, siDeviceIsConnected, siDeviceName, siDeviceNotConnected, siDontKnowIfConnected, siEQSpectrumBands, siEQSpectrumLevels, siEQSpectrumOnOff, siEQToneControlGain, siEQToneControlOnOff, siGoodQuality, siHardwareBalance, siHardwareBalanceSteps, siHardwareBass, siHardwareBassSteps, siHardwareBusy, siHardwareFormat, siHardwareMute, siHardwareMuteNoPrefs, siHardwareTreble, siHardwareTrebleSteps, siHardwareVolume, siHardwareVolumeSteps, siHeadphoneMute, siHeadphoneVolume, siHeadphoneVolumeSteps, siInputAvailable, siInputGain, siInputSource, siInputSourceNames, siLevelMeterOnOff, siModemGain, siMonitorAvailable, siMonitorSource, siNoneQuality, siNumberChannels, siOptionsDialog, siOSTypeInputAvailable, siOSTypeInputSource, siOutputDeviceName, siOutputLatency, siPlayThruOnOff, siPostMixerSoundComponent, siPreMixerSoundComponent, siQuality, siRateConverterRollOffSlope, siRateMultiplier, siReadPermission, siRecordingQuality, siSampleRate, siSampleRateAvailable, siSampleSize, siSampleSizeAvailable, siSetupCDAudio, siSetupModemAudio, siSlopeAndIntercept, siSoundClock, siSpeakerMute, siSpeakerVolume, siSSpCPULoadLimit, siSSpLocalization, siSSpSpeakerSetup, siStereoInputGain, siSubwooferMute, siSupportedExtendedFlags, siTerminalType, siTwosComplementOnOff, siUseThisSoundClock, siVendorProduct, siVolume, siVoxRecordInfo, siVoxStopInfo, siWideStereo, siWritePermission, sixToOne, sixToOnePacketSize, soundCmd, soundListRsrc, squareWaveSynth, stateBlockSize, stdQLength, stdSH, syncCmd, sysBeepDisable, sysBeepEnable, sysBeepSynchronous, threeToOne, threeToOnePacketSize, timbreCmd, totalLoadCmd, twoToOne, unitTypeNoSelection, unitTypeSeconds, variableCompression, versionCmd, volumeCmd, waitCmd, waveTableCmd, waveTableSynth
 
Constructor Summary
SoundSource()
          This is the constructor to use when you don't want a callback.
SoundSource(SoundListener _sListener, int _threshold)
          When you use this constructor, the soundSource listens for you and alerts when the sound has gone over the threshold you supplied.
 
Method Summary
 int getLevel()
          Theoretically you can get the sound level but this crashes for me.
 void kill()
          Be sure to clean up after you are done listening.
 void run()
           
 void soundSettings()
          This seems to crash too.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SoundSource

public SoundSource()
This is the constructor to use when you don't want a callback. Instead you would keep asking getLevel (This crashed for me).


SoundSource

public SoundSource(SoundListener _sListener,
                   int _threshold)
When you use this constructor, the soundSource listens for you and alerts when the sound has gone over the threshold you supplied. You have to give a reference to yourself and you have to implement the SoundListener interface by have a "newSound(int _level)" method. The listening thread is automaticallys started for you so you don't have to do the usual addBlaListener(this).

Method Detail

soundSettings

public void soundSettings()
This seems to crash too.


getLevel

public int getLevel()
Theoretically you can get the sound level but this crashes for me. I guess I should work on it


kill

public void kill()
Be sure to clean up after you are done listening.


run

public void run()
Specified by:
run in interface java.lang.Runnable