org.lwjgl.fmod3
Class FSound

java.lang.Object
  extended by org.lwjgl.fmod3.FSound

public class FSound
extends java.lang.Object


Version:
$Revision: 2567 $ $Id: FSound.java 2567 2006-08-31 16:40:53 +0000 (to, 31 aug 2006) matzon $
Author:
Brian Matzon

Field Summary
static int FSOUND_16BITS
          For 16 bit samples.
static int FSOUND_2D
          Tells software (not hardware) based sample not to be included in 3d processing.
static int FSOUND_8BITS
          For 8 bit samples.
static int FSOUND_ALL
           
static int FSOUND_CAPS_EAX2
          This driver supports EAX2 reverb
static int FSOUND_CAPS_EAX3
          This driver supports EAX3 reverb
static int FSOUND_CAPS_HARDWARE
          This driver supports hardware accelerated 3d sound.
static int FSOUND_CD_PLAYCONTINUOUS
           
static int FSOUND_CD_PLAYLOOPED
           
static int FSOUND_CD_PLAYONCE
           
static int FSOUND_CD_PLAYRANDOM
           
static int FSOUND_DELTA
          For user created source data stored as delta values.
static int FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT
          DSP CLEAR unit - done first
static int FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT
          DSP CLIP AND COPY unit - last
static int FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT
          This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units
static int FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT
          DSP MUSIC unit - done third
static int FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT
          DSP SFX unit - done second
static int FSOUND_DSP_DEFAULTPRIORITY_USER
          User priority, use this as reference
static int FSOUND_ENABLEFX
          Allows DX8 FX to be played back on a sound.
static int FSOUND_FORCEMONO
          For forcing stereo streams and samples to be mono - needed if using FSOUND_HW3D and stereo data - incurs a small speed hit for streams
static int FSOUND_FORMAT_MPEG
           
static int FSOUND_FORMAT_OGGVORBIS
           
static int FSOUND_FREE
           
static int FSOUND_FX_CHORUS
           
static int FSOUND_FX_COMPRESSOR
           
static int FSOUND_FX_DISTORTION
           
static int FSOUND_FX_ECHO
           
static int FSOUND_FX_FLANGER
           
static int FSOUND_FX_GARGLE
           
static int FSOUND_FX_I3DL2REVERB
           
static int FSOUND_FX_MAX
           
static int FSOUND_FX_PARAMEQ
           
static int FSOUND_FX_WAVES_REVERB
           
static int FSOUND_GCADPCM
          For Gamecube only - Contents are compressed as Gamecube DSP-ADPCM format
static int FSOUND_HW2D
          2D hardware sounds.
static int FSOUND_HW3D
          Attempts to make samples use 3d hardware acceleration.
static int FSOUND_IGNORETAGS
          Skips id3v2 etc tag checks when opening a stream, to reduce seek/read overhead when opening files (helps with CD performance)
static int FSOUND_IMAADPCM
          Contents are stored compressed as IMA ADPCM
static int FSOUND_INIT_ACCURATEVULEVELS
          This latency adjusts FSOUND_GetCurrentLevels, but incurs a small cpu and memory hit
static int FSOUND_INIT_DONTLATENCYADJUST
          Callbacks are not latency adjusted, and are called at mix time.
static int FSOUND_INIT_DSOUND_DEFERRED
          Win32 only - For DirectSound output. 3D commands are batched together and executed at FSOUND_Update.
static int FSOUND_INIT_DSOUND_HRTF_FULL
          Win32 only - For DirectSound output.
static int FSOUND_INIT_DSOUND_HRTF_LIGHT
          Win32 only - For DirectSound output.
static int FSOUND_INIT_ENABLESYSTEMCHANNELFX
          Win32 only - For DirectSound output - Allows FSOUND_FX api to be used on global software mixer output!
static int FSOUND_INIT_GC_INITLIBS
          GC only - Initializes GC audio libraries
static int FSOUND_INIT_GLOBALFOCUS
          Win32 only - For DirectSound output - sound is not muted when window is out of focus.
static int FSOUND_INIT_PS2_DISABLECORE0REVERB
          PS2 only - Disable reverb on CORE 0 to regain SRAM
static int FSOUND_INIT_PS2_DISABLECORE1REVERB
          PS2 only - Disable reverb on CORE 1 to regain SRAM
static int FSOUND_INIT_PS2_SWAPDMACORES
          PS2 only - By default FMOD uses DMA CH0 for mixing, CH1 for uploads, this flag swaps them around
static int FSOUND_INIT_PS2_USEVOLUMERAMPING
          PS2 only - Turns on volume ramping system to remove hardware clicks.
static int FSOUND_INIT_STREAM_FROM_MAIN_THREAD
          Turns off fmod streamer thread, and makes streaming update from FSOUND_Update called by the user
static int FSOUND_INIT_USEDEFAULTMIDISYNTH
          Win32 only - Causes MIDI playback to force software decoding.
static int FSOUND_IT214
          For user created source data stored using IT214 compression.
static int FSOUND_IT215
          For user created source data stored using IT215 compression.
static int FSOUND_LOADMEMORY
          "name" will be interpreted as a pointer to data for streaming and samples.
static int FSOUND_LOADMEMORYIOP
          For PS2 only - "name" will be interpreted as a pointer to data for streaming and samples.
static int FSOUND_LOADRAW
          Will ignore file format and treat as raw pcm.
static int FSOUND_LOOP_BIDI
          For bidirectional looping samples.
static int FSOUND_LOOP_NORMAL
          For forward looping samples.
static int FSOUND_LOOP_OFF
          For non looping samples.
static int FSOUND_MIXER_AUTODETECT
          CE/PS2/GC Only - Non interpolating/low quality mixer.
static int FSOUND_MIXER_BLENDMODE
          Removed / obsolete.
static int FSOUND_MIXER_MAX
           
static int FSOUND_MIXER_MMXP5
          Removed / obsolete.
static int FSOUND_MIXER_MMXP6
          Removed / obsolete.
static int FSOUND_MIXER_MONO
          CE/PS2/GC only - MONO non interpolating/low quality mixer.
static int FSOUND_MIXER_QUALITY_AUTODETECT
          All platforms - Autodetect the fastest quality mixer based on your cpu.
static int FSOUND_MIXER_QUALITY_FPU
          Win32/Linux only - Interpolating/volume ramping FPU mixer.
static int FSOUND_MIXER_QUALITY_MMXP5
          Win32/Linux only - Interpolating/volume ramping P5 MMX mixer.
static int FSOUND_MIXER_QUALITY_MMXP6
          Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer.
static int FSOUND_MIXER_QUALITY_MONO
          CE/PS2/GC only - MONO Interpolating mixer.
static int FSOUND_MONO
          For mono samples.
static int FSOUND_MPEGACCURATE
          For FSOUND_Stream_Open - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime.
static int FSOUND_MPEGHALFRATE
          For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution
static int FSOUND_MULTICHANNEL
          For PS2 and Gamecube only - Contents are interleaved into a multi-channel (more than stereo) format
static int FSOUND_NONBLOCKING
          For FSOUND_Stream_Open/FMUSIC_LoadSong - Causes stream or music to open in the background and not block the foreground app.
static int FSOUND_NORMAL
           
static int FSOUND_OUTPUT_A3D
          A3D driver.
static int FSOUND_OUTPUT_ALSA
          Linux Alsa driver.
static int FSOUND_OUTPUT_ASIO
          Low latency ASIO driver
static int FSOUND_OUTPUT_DSOUND
          DirectSound driver.
static int FSOUND_OUTPUT_ESD
          Linux/Unix ESD (Enlightment Sound Daemon) driver.
static int FSOUND_OUTPUT_GC
          Gamecube driver
static int FSOUND_OUTPUT_MAC
          Mac SoundMager driver
static int FSOUND_OUTPUT_NOSOUND
          NoSound driver, all calls to this succeed but do nothing.
static int FSOUND_OUTPUT_NOSOUND_NONREALTIME
          This is the same As nosound, but the sound generation is driven by FSOUND_Update
static int FSOUND_OUTPUT_OSS
          Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers.
static int FSOUND_OUTPUT_PS2
          PlayStation 2 driver
static int FSOUND_OUTPUT_WINMM
          Windows Multimedia driver.
static int FSOUND_OUTPUT_XBOX
          Xbox driver
static int FSOUND_PROTOCOL_HTTP
           
static int FSOUND_PROTOCOL_ICECAST
           
static int FSOUND_PROTOCOL_SHOUTCAST
           
static int FSOUND_REVERB_FLAGS_CORE0
           
static int FSOUND_REVERB_FLAGS_CORE1
           
static int FSOUND_REVERB_FLAGS_DECAYHFLIMIT
           
static int FSOUND_REVERB_FLAGS_DECAYTIMESCALE
           
static int FSOUND_REVERB_FLAGS_DEFAULT
           
static int FSOUND_REVERB_FLAGS_ECHOTIMESCALE
           
static int FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE
           
static int FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE
           
static int FSOUND_REVERB_FLAGS_REFLECTIONSSCALE
           
static int FSOUND_REVERB_FLAGS_REVERBDELAYSCALE
           
static int FSOUND_REVERB_FLAGS_REVERBSCALE
           
static int FSOUND_SIGNED
          For user created source data containing signed data.
static int FSOUND_SPEAKERMODE_DOLBYDIGITAL
          Dolby Digital Output (XBOX or PC only).
static int FSOUND_SPEAKERMODE_DTS
          DTS output (XBOX only).
static int FSOUND_SPEAKERMODE_HEADPHONES
          The speakers are headphones.
static int FSOUND_SPEAKERMODE_MONO
          The speakers are monaural.
static int FSOUND_SPEAKERMODE_PROLOGIC2
          Dolby Prologic 2.
static int FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR
           
static int FSOUND_SPEAKERMODE_QUAD
          The speakers are quadraphonic.
static int FSOUND_SPEAKERMODE_STEREO
          The speakers are stereo (default value).
static int FSOUND_SPEAKERMODE_SURROUND
          The speakers are surround sound.
static int FSOUND_STEREO
          For stereo samples.
static int FSOUND_STEREOPAN
           
static int FSOUND_STREAM_NET
          Specifies an internet stream
static int FSOUND_STREAM_NET_BUFFERING
          Stream is buffering data
static int FSOUND_STREAM_NET_CONNECTING
          Stream is connecting to remote host
static int FSOUND_STREAM_NET_ERROR
          Stream has suffered a fatal error
static int FSOUND_STREAM_NET_NOTCONNECTED
          Stream hasn't connected yet
static int FSOUND_STREAM_NET_READY
          Stream is ready to play
static int FSOUND_STREAMABLE
          For a streamimg sound where you feed the data to it.
static int FSOUND_SYSTEMCHANNEL
           
static int FSOUND_SYSTEMSAMPLE
           
static int FSOUND_TAGFIELD_ASF
          An Advanced Streaming Format header line
static int FSOUND_TAGFIELD_ICECAST
          An Icecast header line
static int FSOUND_TAGFIELD_ID3V1
          Part of an ID3v1 tag
static int FSOUND_TAGFIELD_ID3V2
          An ID3v2 frame
static int FSOUND_TAGFIELD_SHOUTCAST
          A SHOUTcast header line
static int FSOUND_TAGFIELD_VORBISCOMMENT
          A vorbis comment
static int FSOUND_UNMANAGED
           
static int FSOUND_UNSIGNED
          For user created source data containing unsigned samples.
static int FSOUND_USECORE0
          For PS2 only - Sample/Stream is forced to use hardware voices 00-23
static int FSOUND_USECORE1
          For PS2 only - Sample/Stream is forced to use hardware voices 24-47
static int FSOUND_VAG
          For PS2 only - Contents are compressed as Sony VAG format
 
Constructor Summary
FSound()
           
 
Method Summary
static boolean FSOUND_3D_GetAttributes(int channel, java.nio.FloatBuffer pos, java.nio.FloatBuffer vel)
           Remarks A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor.
static boolean FSOUND_3D_GetMinMaxDistance(int channel, java.nio.FloatBuffer minmax)
          Returns the current min and max distance for a channel
static void FSOUND_3D_Listener_GetAttributes(java.nio.FloatBuffer pos, java.nio.FloatBuffer vel, java.nio.FloatBuffer fx, java.nio.FloatBuffer fy, java.nio.FloatBuffer fz, java.nio.FloatBuffer tx, java.nio.FloatBuffer ty, java.nio.FloatBuffer tz)
          This retreives the position, velocity and orientation of a 3d sound listener Remarks FSOUND treats +X as right, +Y as up, and +Z as forwards.
static void FSOUND_3D_Listener_SetAttributes(java.nio.FloatBuffer pos, java.nio.FloatBuffer vel, float fx, float fy, float fz, float tx, float ty, float tz)
          This updates the position, velocity and orientation of a 3d sound listener Remarks FSOUND treats +X as right, +Y as up, and +Z as forwards.
static void FSOUND_3D_Listener_SetCurrent(int current, int numlisteners)
          Sets the current listener number and number of listeners, if the user wants to simulate multiple listeners at once.
static boolean FSOUND_3D_SetAttributes(int channel, java.nio.FloatBuffer pos, java.nio.FloatBuffer vel)
          This updates the position and velocity of a 3d sound playing on a channel Remarks FSOUND treats +X as right, +Y as up, and +Z as forwards. --------- A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor.
static void FSOUND_3D_SetDistanceFactor(float scale)
          Sets FMOD's 3d engine relative distance factor, compared to 1.0 meters.
static void FSOUND_3D_SetDopplerFactor(float scale)
          Sets the doppler shift scale factor.
static boolean FSOUND_3D_SetMinMaxDistance(int channel, float min, float max)
          Sets the minimum and maximum audible distance for a channel.
static void FSOUND_3D_SetRolloffFactor(float rolloff)
          Sets the global attenuation rolloff factor.
static int FSOUND_CD_GetNumTracks(char drive)
          Returns the number of tracks on the currently inserted CD
static boolean FSOUND_CD_GetPaused(char drive)
          Gets the pause status of the current CD audio track
static int FSOUND_CD_GetTrack(char drive)
          Returns the currently playing CD track number
static int FSOUND_CD_GetTrackLength(char drive, int track)
          Gets the track length of a CD
static int FSOUND_CD_GetTrackTime(char drive)
          Returns the current track time playing on a CD Remarks This is easily one of the slowest functions in the FMOD API.
static boolean FSOUND_CD_OpenTray(char drive, boolean open)
          Opens/Closes the CD tray
static boolean FSOUND_CD_Play(char drive, int track)
          Plays a CD Audio track Remarks See FSOUND_CD_SetPlayMode for information on how to control playback of a CD track.
static boolean FSOUND_CD_SetPaused(char drive, boolean paused)
          Sets the pause status of the currently playing CD audio track
static void FSOUND_CD_SetPlayMode(char drive, int mode)
          Sets the playback mode of the CD
static boolean FSOUND_CD_SetTrackTime(char drive, int ms)
          Performs a seek within a track specified by milliseconds Remarks This function will start the track if it is not playing
static boolean FSOUND_CD_SetVolume(char drive, int volume)
          Sets the volume of the playing CD audio
static boolean FSOUND_CD_Stop(char drive)
          Stops the currently playing CD audio track
static void FSOUND_Close()
          Shuts down the WHOLE FMOD Sound System Remarks This also closes down the sample management system, freeing all MANAGED samples loaded (unless they were allocated with the FSOUND_UNMANAGED flag).
static void FSOUND_DSP_ClearMixBuffer()
          Clears the mixbuffer, especially handy if you are doing a large file operation which halts the system.
static FSoundDSPUnit FSOUND_DSP_Create(FSoundDSPCallback callbackHandler, int priority)
          Creates a DSP unit, and places it in the DSP chain position specified by the priority parameter.
static void FSOUND_DSP_Free(FSoundDSPUnit unit)
          Frees and removes a DSP unit from the DSP chain
static boolean FSOUND_DSP_GetActive(FSoundDSPUnit unit)
          Returns if a DSP unit is active or not Remarks It is possible to toggle on and off FSOUNDs internal DSP units, though not recommended
static int FSOUND_DSP_GetBufferLength()
          Returns the buffer lenth passed by the DSP system to DSP unit callbacks, so you can allocate memory etc using this data Remarks Remember this is samples not bytes.
static int FSOUND_DSP_GetBufferLengthTotal()
          This is the total size in samples (not bytes) of the FSOUND mix buffer.
static FSoundDSPUnit FSOUND_DSP_GetClearUnit()
          Returns a reference to FSOUND's system DSP clear unit Remarks The FSOUND clear DSP unit simply sets the mix buffer to 0, silencing it
static FSoundDSPUnit FSOUND_DSP_GetClipAndCopyUnit()
          Returns a reference to FSOUND's system Clip and Copy DSP unit Remarks The FSOUND ClipAndCopy DSP unit clips the 32bit buffer down to fit the soundcard's 16bit stereo output, and sends it off to the hardware.
static FSoundDSPUnit FSOUND_DSP_GetFFTUnit()
          Returns a reference to FSOUND's system DSP FFT processing unit Remarks The FSOUND FFT DSP executes the FFT engine to allow FSOUND_DSP_GetSpectrum to be used.
static FSoundDSPUnit FSOUND_DSP_GetMusicUnit()
          Returns a reference to FSOUND's system DSP Music mixer unit Remarks The FSOUND Music DSP executes the FMUSIC engine and mixes the sounds spawned by the music player
static int FSOUND_DSP_GetPriority(FSoundDSPUnit unit)
          Returns the priority status in the DSP chain, of a specified unit.
static FSoundDSPUnit FSOUND_DSP_GetSFXUnit()
          Returns a reference to FSOUND's system DSP SFX mixer unit Remarks The FSOUND SFX DSP unit mixes sound effects together spawned by the user
static java.nio.FloatBuffer FSOUND_DSP_GetSpectrum()
          Function to return a FloatBuffer to the current spectrum buffer.
static boolean FSOUND_DSP_MixBuffers(java.nio.ByteBuffer destbuffer, java.nio.ByteBuffer srcbuffer, int len, int freq, int vol, int pan, int mode)
          Allows the user to mix their own data from one buffer to another, using FSOUNDs optimized mixer routines.
static void FSOUND_DSP_SetActive(FSoundDSPUnit unit, boolean active)
          Allows the user to toggle a DSP unit on or off Remarks It is possible to toggle on and off FSOUNDs internal DSP units, though not recommended
static void FSOUND_DSP_SetPriority(FSoundDSPUnit unit, int priority)
          Changes a DSP Unit's priority position in the DSP chain Remarks DSP units with the same priority as a previous unit already in the chain will be placed AFTER all like priority units
static void FSOUND_File_SetCallbacks(FSoundOpenCallback open, FSoundCloseCallback close, FSoundReadCallback read, FSoundSeekCallback seek, FSoundTellCallback tell)
          Specify user callbacks for FMOD's internal file manipulation functions.
static boolean FSOUND_FX_Disable(int channel)
          Disables effect processing for ALL effects on the specified channel Remarks FSOUND_ALL is supported.
static int FSOUND_FX_Enable(int channel, int fxtype)
          Enables effect processing for the specified channel.
static boolean FSOUND_FX_SetChorus(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase)
          Sets the parameters for the chorus effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_CHORUS before using this function.
static boolean FSOUND_FX_SetCompressor(int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay)
          Sets the parameters for the compressor effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_COMPRESSOR before using this function
static boolean FSOUND_FX_SetDistortion(int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff)
          Sets the parameters for the distortion effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_DISTORTION before using this function
static boolean FSOUND_FX_SetEcho(int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay)
          Sets the parameters for the echo effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_ECHO before using this function.
static boolean FSOUND_FX_SetFlanger(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase)
          Sets the parameters for the echo effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_FLANGER before using this function.
static boolean FSOUND_FX_SetGargle(int fxid, int RateHz, int WaveShape)
          Sets the parameters for the echo effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_GARGLE before using this function.
static boolean FSOUND_FX_SetI3DL2Reverb(int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, float ReverbDelay, float Diffusion, float Density, float HFReference)
          Sets the parameters for the I3DL2 Reverb effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_I3DL2REVERB before using this function.
static boolean FSOUND_FX_SetParamEQ(int fxid, float Center, float Bandwidth, float Gain)
          Sets the parameters for the I3DL2 Reverb effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_PARAMEQ before using this function.
static boolean FSOUND_FX_SetWavesReverb(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio)
          Sets the parameters for the Waves Reverb effect on a particular channel Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_WAVES_REVERB before using this function.
static int FSOUND_GetAmplitude(int channel)
          Returns the volume of the channel based on all combinations of set volume, mastervolume and 3d position.
static int FSOUND_GetChannelsPlaying()
          Returns the number of active channels in FSOUND, or ones that are playing
static float FSOUND_GetCPUUsage()
          Returns in percent of cpu time the amount of cpu usage that FSOUND/FMUSIC mixing is taking Remarks This value represents the cpu usage used by streams, the software mixer, and subsequent calls to dsound waveout etc.
static boolean FSOUND_GetCurrentLevels(int channel, java.nio.FloatBuffer l_r)
          Returns a left and right VU/Level reading at the current position of the specified channel.
static int FSOUND_GetCurrentPosition(int channel)
          Returns the current playcursor position of the specified channel
static FSoundSample FSOUND_GetCurrentSample(int channel)
          Returns the current sample being played on the specified channel Remarks Note that current sample does not return to NULL when a sound has ended.
static int FSOUND_GetDriver()
          Returns the currently selected driver number.
static boolean FSOUND_GetDriverCaps(int driverid, java.nio.IntBuffer caps)
          Returns information on capabilities of the current output mode
static java.lang.String FSOUND_GetDriverName(int driverid)
          Returns the name of the selected driver.
static int FSOUND_GetError()
          Returns an error code set by FMOD
static int FSOUND_GetFrequency(int channel)
          Returns the frequency in HZ of the specified channel
static int FSOUND_GetLoopMode(int channel)
          Gets the loop mode for a particular channel Remarks This works for all channel types, whereas setting it will not work.
static int FSOUND_GetMaxChannels()
          Returns the total number of channels allocated
static int FSOUND_GetMaxSamples()
          Returns the current maximum index for a sample.
static void FSOUND_GetMemoryStats(java.nio.IntBuffer currentallocated_maxallocated)
          Returns information on the memory usage of fmod.
static int FSOUND_GetMixer()
          Returns the currently used mixer type
static boolean FSOUND_GetMute(int channel)
          Returns if the channel specified is muted or not
static int FSOUND_GetNumDrivers()
          Returns the number of sound cards or devices enumerated for the current output type.
static boolean FSOUND_GetNumHWChannels(java.nio.IntBuffer twoD_threeD_channels_total)
          Returns the number of available hardware mixed 2d and 3d channels
static int FSOUND_GetNumSubChannels(int channel)
          This function returns the number of sub-channels stored in a multi-channel channel handle, which is only possible when playing back a multichannel .FSB file.
static int FSOUND_GetOutput()
          Returns the current id to the output type.
static int FSOUND_GetOutputRate()
          Returns the current mixing rate
static int FSOUND_GetPan(int channel)
          Returns the linear pan position of the specified channel between 0 and 255
static boolean FSOUND_GetPaused(int channel)
          Gets current pause status of the channel Remarks This function is useful for games that have a pause mode, and you dont want the sounds to continue playing, but you would like them to continue on from where they left off when you unpause.
static int FSOUND_GetPriority(int channel)
          Gets a sound channels priority.
static int FSOUND_GetReserved(int channel)
          Gets a sound channels reserved status. priority is used to determine if soundeffects should muscle out other sound effects when the channel limit has been reached.
static int FSOUND_GetSFXMasterVolume()
          Returns the master volume for any sound effects played.
static int FSOUND_GetSubChannel(int channel, int subchannel)
          This function returns a channel handle from a subchannel within a multichannel FSB file, so that it can be maniuplated seperately, instead of controlling the whole multichannel array with the parent channel that the user retrieves from FSOUND_PlaySound etc.
static int FSOUND_GetSurround(int channel)
          Returns the surround sound status of the specified channel.
static float FSOUND_GetVersion()
          Returns the FMOD version number Remarks Use this to compare the header you are using against the compiled DLL version to make sure your DLL is up to date.
static int FSOUND_GetVolume(int channel)
          Returns the linear volume of the specified channel between 0 and 255
static boolean FSOUND_Init(int mixrate, int channels, int flags)
          Initializes the FMOD Sound System.
static boolean FSOUND_IsPlaying(int channel)
          Returns if the channel is currently playing or not.
static int FSOUND_PlaySound(int channel, FSoundSample sample)
          Plays a sample in a specified channel, using the sample's default frequency, volume and pan settings.
static int FSOUND_Record_GetDriver()
          Returns the currently selected recording driver number.
static java.lang.String FSOUND_Record_GetDriverName(int id)
          Returns the name of the selected recording driver.
static int FSOUND_Record_GetNumDrivers()
          Returns the number of sound cards or devices enumerated for the current input type.
static int FSOUND_Record_GetPosition()
          Gets the position in the sample buffer that has been recorded to Remarks Note.
static boolean FSOUND_Record_SetDriver(int driverno)
          Returns the name of the selected recording driver.
static boolean FSOUND_Record_StartSample(FSoundSample sample, boolean loop)
          Starts recording into a predefined sample using the sample's default playback rate as the recording rate Remarks If you want to play back the sample at the same time is is recording, you will have to play the sound and try and keep it just behind the recording cursor.
static boolean FSOUND_Record_Stop()
          Halts recording to the specified sample
static boolean FSOUND_Reverb_GetChannelProperties(int channel, FSoundReverbChannelProperties reverb)
          This function gets the current reverb properties for this channel
static boolean FSOUND_Reverb_GetProperties(FSoundReverbProperties reverb)
          Returns the current hardware reverb environment.
static boolean FSOUND_Reverb_SetChannelProperties(int channel, FSoundReverbChannelProperties reverb)
          Sets the channel specific reverb properties for hardware, including wet/dry mix (room size), and things like obstruction and occlusion properties Remarks FSOUND_ALL is supported here.
static boolean FSOUND_Reverb_SetProperties(FSoundReverbProperties reverb)
          Sets hardware reverb parameters for advanced tuning.
static FSoundSample FSOUND_Sample_Alloc(int index, int length, int mode, int deffreq, int defvol, int defpan, int defpri)
          Allocates a new empty sample.
static void FSOUND_Sample_Free(FSoundSample sample)
          Removes a sample from memory and makes its slot available again
static FSoundSample FSOUND_Sample_Get(int sampno)
          Returns a reference to a managed sample based on the index passed Remarks Samples that are not created with FSOUND_UNMANAGED are stored in a table inside FMOD.
static boolean FSOUND_Sample_GetDefaults(FSoundSample sample, java.nio.IntBuffer deffreq, java.nio.IntBuffer defvol, java.nio.IntBuffer defpan, java.nio.IntBuffer defpri)
          Returns the default volume, frequency, pan and priority values for the specified sample Remarks Passing NULL in any of these parameters will result in the value being ignored
static boolean FSOUND_Sample_GetDefaultsEx(FSoundSample sample, java.nio.IntBuffer deffreq, java.nio.IntBuffer defvol, java.nio.IntBuffer defpan, java.nio.IntBuffer defpri, java.nio.IntBuffer varfreq, java.nio.IntBuffer varvol, java.nio.IntBuffer varpan)
          Returns the default volume, frequency, pan, priority and random playback variations for the specified sample Remarks Passing NULL in any of these parameters will result in the value being ignored
static int FSOUND_Sample_GetLength(FSoundSample sample)
          Returns the length of the sample in SAMPLES
static int FSOUND_Sample_GetLoopPoints(FSoundSample sample, java.nio.IntBuffer loopstart, java.nio.IntBuffer loopend)
          Returns the start and end positions of the specified sample loop in SAMPLES (not bytes) Remarks Passing NULL in any of these parameters will result in the value being ignored.
static int FSOUND_Sample_GetMinMaxDistance(FSoundSample sample, java.nio.FloatBuffer min, java.nio.FloatBuffer max)
          Get the minimum and maximum audible distance for a sample Remarks A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor.
static int FSOUND_Sample_GetMode(FSoundSample sample)
          Returns a bitfield containing information about the specified sample.
static java.lang.String FSOUND_Sample_GetName(FSoundSample sample)
          Returns a string containing the sample's name
static FSoundSample FSOUND_Sample_Load(int index, java.nio.ByteBuffer data, int inputmode)
          Loads and decodes a static soundfile into memory.
static FSoundSample FSOUND_Sample_Load(int index, java.lang.String name, int inputmode, int offset, int length)
           
static boolean FSOUND_Sample_Lock(FSoundSample sample, int offset, int length, FSoundSampleLock lock)
          Returns a reference to the beginning of the sample data for a sample.
static boolean FSOUND_Sample_SetDefaults(FSoundSample sample, int deffreq, int defvol, int defpan, int defpri)
          Sets a sample's default attributes, so when it is played it uses these values without having to specify them later.
static boolean FSOUND_Sample_SetDefaultsEx(FSoundSample sample, int deffreq, int defvol, int defpan, int defpri, int varfreq, int varvol, int varpan)
          Sets a sample's default attributes, so when it is played it uses these values without having to specify them later.
static boolean FSOUND_Sample_SetMaxPlaybacks(FSoundSample sample, int max)
          Sets the maximum number of times a sample can play back at once
static boolean FSOUND_Sample_SetMinMaxDistance(FSoundSample sample, float min, float max)
          Sets the minimum and maximum audible distance for a sample.
static boolean FSOUND_Sample_SetMode(FSoundSample sample, int mode)
          Sets a sample's mode.
static boolean FSOUND_Sample_Unlock(FSoundSample sample, FSoundSampleLock lock)
          Releases previous sample data lock from FSOUND_Sample_Lock
static boolean FSOUND_Sample_Upload(FSoundSample sample, java.nio.ByteBuffer srcdata, int mode)
          This function uploads new sound data from memory to a preallocated/existing sample and does conversion based on the specified source mode.
static boolean FSOUND_SetBufferSize(int len_ms)
          Sets the FMOD internal mixing buffer size.
static boolean FSOUND_SetCurrentPosition(int channel, int offset)
          Sets the current position of the sound in SAMPLES not bytes Remarks FSOUND_ALL is supported.
static boolean FSOUND_SetDriver(int driver)
          Selects a soundcard driver.
static boolean FSOUND_SetFrequency(int channel, int freq)
          Sets a channels frequency or playback rate, in Hz.
static boolean FSOUND_SetLevels(int channel, int frontleft, int center, int frontright, int backleft, int backright, int lfe)
          XBox Only - For surround sound systems, this function allows each surround speaker level to be set individually for this channel Remarks FSOUND_ALL is supported.
static boolean FSOUND_SetLoopMode(int channel, int loopmode)
          Sets the loop mode for a particular CHANNEL, not sample Remarks FSOUND_ALL is supported.
static boolean FSOUND_SetMaxHardwareChannels(int max)
          This sets the maximum allocatable channels on a hardware card.
static boolean FSOUND_SetMinHardwareChannels(int min)
          This sets the minimum allowable hardware channels before FMOD drops back to 100 percent software.
static boolean FSOUND_SetMixer(int mixer)
          Sets a digital mixer type.
static boolean FSOUND_SetMute(int channel, boolean mute)
          Mutes and un-mutes a channel Remarks FSOUND_ALL is supported.
static boolean FSOUND_SetOutput(int output)
          Sets up the soundsystem output mode Remarks This function cannot be called after FMOD is already activated with FSOUND_Init.
static boolean FSOUND_SetPan(int channel, int pan)
          Sets a channels pan position linearly Remarks FSOUND_ALL is supported.
static void FSOUND_SetPanSeperation(float pansep)
          Sets the master pan seperation for 2d sound effects
static boolean FSOUND_SetPaused(int channel, boolean paused)
          Pauses or unpauses a sound channel Remarks FSOUND_ALL is supported.
static boolean FSOUND_SetPriority(int channel, int priority)
          Sets a channels priority.
static boolean FSOUND_SetReserved(int channel, boolean reserved)
          This sets the reserved status of a channel.
static void FSOUND_SetSFXMasterVolume(int volume)
          Sets the master volume for any sound effects played.
static void FSOUND_SetSpeakerMode(int speakermode)
          Sets the mode for the users speaker setup Remarks Note - Only reliably works with FSOUND_OUTPUT_DSOUND or FSOUND_OUTPUT_XBOX output modes.
static boolean FSOUND_SetSurround(int channel, boolean surround)
          Sets a channels surround sound status.
static boolean FSOUND_SetVolume(int channel, int vol)
          Sets a channels volume linearly.
static boolean FSOUND_SetVolumeAbsolute(int channel, int vol)
          Sets a channels volume linearly.
static boolean FSOUND_StopSound(int channel)
          Stops a specified sound channel from playing, and frees it up for re-use Remarks FSOUND_ALL is supported.
static FSoundSyncPoint FSOUND_Stream_AddSyncPoint(FSoundStream stream, int pcmoffset, java.lang.String name)
          Adds a user synchronization callback point into a stream Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready
static boolean FSOUND_Stream_Close(FSoundStream stream)
          Shuts down and releases an FSOUND stream Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.
static FSoundStream FSOUND_Stream_Create(FSoundStreamCallback callbackHandler, int lenbytes, int mode, int samplerate)
          Creates a user definable stream file ready for playing.
static FSoundDSPUnit FSOUND_Stream_CreateDSP(FSoundStream stream, FSoundDSPCallback callback, int priority)
          Allows the user to add a custom DSP unit to a stream Remarks The priority for a stream DSP unit is not related to the priorities specified in fmod.h.
static boolean FSOUND_Stream_DeleteSyncPoint(FSoundSyncPoint point)
          Removes a user synchronization callback point from a stream.
static boolean FSOUND_Stream_FindTagField(FSoundStream stream, FSoundTagField field)
          Find a tag field associated with an open stream by name and type
static int FSOUND_Stream_GetLength(FSoundStream stream)
          Returns the size of the stream in BYTES Remarks Position functions for streams work in bytes not samples. ----- This function is not supported for URL based streams over the internet.
static int FSOUND_Stream_GetLengthMs(FSoundStream stream)
          Returns the size of the stream in MILLISECONDS Remarks FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy
static int FSOUND_Stream_GetMode(FSoundStream stream)
          Retrieves the mode of the stream Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.
static int FSOUND_Stream_GetNumSubStreams(FSoundStream stream)
          Returns the number of substreams inside a multi-stream FSB bank file
static boolean FSOUND_Stream_GetNumTagFields(FSoundStream stream, java.nio.IntBuffer num)
          Get the number of tag fields associated with the specified stream
static int FSOUND_Stream_GetOpenState(FSoundStream stream)
          If a stream is opened with FSOUND_NONBLOCKING, this function returns the state of the opening stream Remarks A blocking stream will return NULL from FSOUND_Stream_Open so a return value of -3 is redundant in this case.
static int FSOUND_Stream_GetPosition(FSoundStream stream)
          Returns the current FILE position of the stream of the stream in BYTES Remarks Position functions for streams work in bytes not samples.
static FSoundSample FSOUND_Stream_GetSample(FSoundStream stream)
          Returns the FSOUND_SAMPLE definition that the stream uses internally.
static FSoundSyncPoint FSOUND_Stream_GetSyncPoint(FSoundStream stream, int index)
          Obtains a sync point by index.
static java.lang.String FSOUND_Stream_GetSyncPointInfo(FSoundSyncPoint point, java.nio.IntBuffer pcmoffset)
          Retrieves the name and pcm offset in samples for a specified sync point Remarks Convert samples to time by dividing the PCM value by the default samplerate.
static boolean FSOUND_Stream_GetTagField(FSoundStream stream, int num, FSoundTagField field)
          Get a tag field associated with an open stream Remarks If this function returns successfully, "value" will contain a pointer to a piece of tag-field-specific data - do not assume it will always point to a null-terminated ASCII string.
static int FSOUND_Stream_GetTime(FSoundStream stream)
          Returns the current time offset in stream in milliseconds.
static boolean FSOUND_Stream_Net_GetBufferProperties(java.nio.IntBuffer values)
          Gets buffer size and thresholds that will be used when opening new internet streams Remarks This function returns the values that will be used for subsequent internet stream opens.
static java.lang.String FSOUND_Stream_Net_GetLastServerStatus()
          This function returns a String representing the last HTTP status line that was received when connecting to an internet stream Remarks The result of this function should be used for informational purposes only.
static boolean FSOUND_Stream_Net_GetStatus(FSoundStream stream, java.nio.IntBuffer values)
          Get various status information for an internet stream
static boolean FSOUND_Stream_Net_SetBufferProperties(int buffersize, int prebuffer_percent, int rebuffer_percent)
          Sets buffer size and thresholds to use when opening new internet streams Remarks Call this function before FSOUND_Stream_Open.
static boolean FSOUND_Stream_Net_SetMetadataCallback(FSoundStream stream, FSoundMetaDataCallback callback)
          Set a metadata callback for an internet stream Remarks The supplied metadata callback function will be called each time the specified internet stream receives a chunk of metadata.
static boolean FSOUND_Stream_Net_SetProxy(java.lang.String proxy)
          Set a proxy server to use for all subsequent internet connections
static FSoundStream FSOUND_Stream_Open(java.nio.ByteBuffer data, int mode)
           
static FSoundStream FSOUND_Stream_Open(java.lang.String name, int mode, int offset, int length)
          Opens an audio file/url/cd ready for streaming.
static int FSOUND_Stream_Play(int channel, FSoundStream stream)
          Starts a pre-opened stream playing Remarks When a stream starts to play, it inherits a special high priority (256).
static int FSOUND_Stream_PlayEx(int channel, FSoundStream stream, FSoundDSPUnit dspunit, boolean paused)
          Extended featured version of FSOUND_Stream_Play.
static boolean FSOUND_Stream_SetBufferSize(int ms)
          Sets the internal file buffersize for audio streaming of data for the NEXT stream opened with FSOUND_Stream_Open.
static boolean FSOUND_Stream_SetEndCallback(FSoundStream stream, FSoundStreamCallback callback)
          Sets a callback function for when a stream has ended Remarks Only calls back when a stream stops.
static int FSOUND_Stream_SetLoopCount(FSoundStream stream, int count)
          Sets the stream to loop the number of times specified by the user.
static int FSOUND_Stream_SetLoopPoints(FSoundStream stream, int loopstart, int loopend)
          Sets the loop points for a stream Remarks For streams, setting looppoints is reasonably accurate but should not be assumed to be perfectly sample accurate in all cases.
static int FSOUND_Stream_SetMode(FSoundStream stream, int mode)
          Set a streams mode Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.
static int FSOUND_Stream_SetPosition(FSoundStream stream, int position)
          Set a streams mode Remarks Position functions for streams talk in bytes and NOT samples.
static int FSOUND_Stream_SetSubStream(FSoundStream stream, int index)
          Seeks a stream to the substream inside a multi-stream FSB bank file, specified by its index Remarks A stream will stop if this function is called, as it needs to seek and flush the buffer.
static int FSOUND_Stream_SetSubStreamSentence(FSoundStream stream, java.nio.IntBuffer sentencelist)
          This function allows the user to describe the playback order of a list of substreams.
static boolean FSOUND_Stream_SetSyncCallback(FSoundStream stream, FSoundStreamCallback callback)
          Sets a callback function for when a stream passes over a WAV tag/marker.
static int FSOUND_Stream_SetTime(FSoundStream stream, int ms)
          Sets the current stream's FILE position in MILLISECONDS Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.
static boolean FSOUND_Stream_Stop(FSoundStream stream)
          Stops a stream from playing Remarks The stream is still prepared and sitting in memory ready to go.
static void FSOUND_Update()
          This updates the 3d sound engine and DMA engine (only on some platforms), and should be called once a game frame.
static int nFSOUND_PlaySoundEx(int channel, FSoundSample sample, FSoundDSPUnit dspunit, boolean startpaused)
          Extended featured version of FSOUND_PlaySound.
static boolean nFSOUND_Sample_SetLoopPoints(FSoundSample sample, int loopstart, int loopend)
          Sets a sample's loop points, specified in SAMPLES, not bytes Remarks Samples created with FSOUND_HW3D and FSOUND_HW2D under the FSOUND_OUTPUT_DSOUND output mode do not support this function.
static int nFSOUND_Stream_GetNumSyncPoints(FSoundStream stream)
          Returns the number of substreams inside a multi-stream FSB bank file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FSOUND_MIXER_AUTODETECT

public static final int FSOUND_MIXER_AUTODETECT
CE/PS2/GC Only - Non interpolating/low quality mixer.

See Also:
Constant Field Values

FSOUND_MIXER_BLENDMODE

public static final int FSOUND_MIXER_BLENDMODE
Removed / obsolete.

See Also:
Constant Field Values

FSOUND_MIXER_MMXP5

public static final int FSOUND_MIXER_MMXP5
Removed / obsolete.

See Also:
Constant Field Values

FSOUND_MIXER_MMXP6

public static final int FSOUND_MIXER_MMXP6
Removed / obsolete.

See Also:
Constant Field Values

FSOUND_MIXER_QUALITY_AUTODETECT

public static final int FSOUND_MIXER_QUALITY_AUTODETECT
All platforms - Autodetect the fastest quality mixer based on your cpu.

See Also:
Constant Field Values

FSOUND_MIXER_QUALITY_FPU

public static final int FSOUND_MIXER_QUALITY_FPU
Win32/Linux only - Interpolating/volume ramping FPU mixer.

See Also:
Constant Field Values

FSOUND_MIXER_QUALITY_MMXP5

public static final int FSOUND_MIXER_QUALITY_MMXP5
Win32/Linux only - Interpolating/volume ramping P5 MMX mixer.

See Also:
Constant Field Values

FSOUND_MIXER_QUALITY_MMXP6

public static final int FSOUND_MIXER_QUALITY_MMXP6
Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer.

See Also:
Constant Field Values

FSOUND_MIXER_MONO

public static final int FSOUND_MIXER_MONO
CE/PS2/GC only - MONO non interpolating/low quality mixer. For speed

See Also:
Constant Field Values

FSOUND_MIXER_QUALITY_MONO

public static final int FSOUND_MIXER_QUALITY_MONO
CE/PS2/GC only - MONO Interpolating mixer. For speed

See Also:
Constant Field Values

FSOUND_MIXER_MAX

public static final int FSOUND_MIXER_MAX
See Also:
Constant Field Values

FSOUND_OUTPUT_NOSOUND

public static final int FSOUND_OUTPUT_NOSOUND
NoSound driver, all calls to this succeed but do nothing.

See Also:
Constant Field Values

FSOUND_OUTPUT_WINMM

public static final int FSOUND_OUTPUT_WINMM
Windows Multimedia driver.

See Also:
Constant Field Values

FSOUND_OUTPUT_DSOUND

public static final int FSOUND_OUTPUT_DSOUND
DirectSound driver. You need this to get EAX or EAX2 support, or FX api support.

See Also:
Constant Field Values

FSOUND_OUTPUT_A3D

public static final int FSOUND_OUTPUT_A3D
A3D driver. not supported any more.

See Also:
Constant Field Values

FSOUND_OUTPUT_OSS

public static final int FSOUND_OUTPUT_OSS
Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers.

See Also:
Constant Field Values

FSOUND_OUTPUT_ESD

public static final int FSOUND_OUTPUT_ESD
Linux/Unix ESD (Enlightment Sound Daemon) driver.

See Also:
Constant Field Values

FSOUND_OUTPUT_ALSA

public static final int FSOUND_OUTPUT_ALSA
Linux Alsa driver.

See Also:
Constant Field Values

FSOUND_OUTPUT_ASIO

public static final int FSOUND_OUTPUT_ASIO
Low latency ASIO driver

See Also:
Constant Field Values

FSOUND_OUTPUT_XBOX

public static final int FSOUND_OUTPUT_XBOX
Xbox driver

See Also:
Constant Field Values

FSOUND_OUTPUT_PS2

public static final int FSOUND_OUTPUT_PS2
PlayStation 2 driver

See Also:
Constant Field Values

FSOUND_OUTPUT_MAC

public static final int FSOUND_OUTPUT_MAC
Mac SoundMager driver

See Also:
Constant Field Values

FSOUND_OUTPUT_GC

public static final int FSOUND_OUTPUT_GC
Gamecube driver

See Also:
Constant Field Values

FSOUND_OUTPUT_NOSOUND_NONREALTIME

public static final int FSOUND_OUTPUT_NOSOUND_NONREALTIME
This is the same As nosound, but the sound generation is driven by FSOUND_Update

See Also:
Constant Field Values

FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT

public static final int FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT
DSP CLEAR unit - done first

See Also:
Constant Field Values

FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT

public static final int FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT
DSP SFX unit - done second

See Also:
Constant Field Values

FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT

public static final int FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT
DSP MUSIC unit - done third

See Also:
Constant Field Values

FSOUND_DSP_DEFAULTPRIORITY_USER

public static final int FSOUND_DSP_DEFAULTPRIORITY_USER
User priority, use this as reference

See Also:
Constant Field Values

FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT

public static final int FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT
This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units

See Also:
Constant Field Values

FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT

public static final int FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT
DSP CLIP AND COPY unit - last

See Also:
Constant Field Values

FSOUND_CAPS_HARDWARE

public static final int FSOUND_CAPS_HARDWARE
This driver supports hardware accelerated 3d sound.

See Also:
Constant Field Values

FSOUND_CAPS_EAX2

public static final int FSOUND_CAPS_EAX2
This driver supports EAX2 reverb

See Also:
Constant Field Values

FSOUND_CAPS_EAX3

public static final int FSOUND_CAPS_EAX3
This driver supports EAX3 reverb

See Also:
Constant Field Values

FSOUND_LOOP_OFF

public static final int FSOUND_LOOP_OFF
For non looping samples.

See Also:
Constant Field Values

FSOUND_LOOP_NORMAL

public static final int FSOUND_LOOP_NORMAL
For forward looping samples.

See Also:
Constant Field Values

FSOUND_LOOP_BIDI

public static final int FSOUND_LOOP_BIDI
For bidirectional looping samples. (no effect if in hardware).

See Also:
Constant Field Values

FSOUND_8BITS

public static final int FSOUND_8BITS
For 8 bit samples.

See Also:
Constant Field Values

FSOUND_16BITS

public static final int FSOUND_16BITS
For 16 bit samples.

See Also:
Constant Field Values

FSOUND_MONO

public static final int FSOUND_MONO
For mono samples.

See Also:
Constant Field Values

FSOUND_STEREO

public static final int FSOUND_STEREO
For stereo samples.

See Also:
Constant Field Values

FSOUND_UNSIGNED

public static final int FSOUND_UNSIGNED
For user created source data containing unsigned samples.

See Also:
Constant Field Values

FSOUND_SIGNED

public static final int FSOUND_SIGNED
For user created source data containing signed data.

See Also:
Constant Field Values

FSOUND_DELTA

public static final int FSOUND_DELTA
For user created source data stored as delta values.

See Also:
Constant Field Values

FSOUND_IT214

public static final int FSOUND_IT214
For user created source data stored using IT214 compression.

See Also:
Constant Field Values

FSOUND_IT215

public static final int FSOUND_IT215
For user created source data stored using IT215 compression.

See Also:
Constant Field Values

FSOUND_HW3D

public static final int FSOUND_HW3D
Attempts to make samples use 3d hardware acceleration. (if the card supports it)

See Also:
Constant Field Values

FSOUND_2D

public static final int FSOUND_2D
Tells software (not hardware) based sample not to be included in 3d processing.

See Also:
Constant Field Values

FSOUND_STREAMABLE

public static final int FSOUND_STREAMABLE
For a streamimg sound where you feed the data to it.

See Also:
Constant Field Values

FSOUND_LOADMEMORY

public static final int FSOUND_LOADMEMORY
"name" will be interpreted as a pointer to data for streaming and samples.

See Also:
Constant Field Values

FSOUND_LOADRAW

public static final int FSOUND_LOADRAW
Will ignore file format and treat as raw pcm.

See Also:
Constant Field Values

FSOUND_MPEGACCURATE

public static final int FSOUND_MPEGACCURATE
For FSOUND_Stream_Open - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime. WARNING, see FSOUND_Stream_Open for inital opening time performance issues.

See Also:
Constant Field Values

FSOUND_FORCEMONO

public static final int FSOUND_FORCEMONO
For forcing stereo streams and samples to be mono - needed if using FSOUND_HW3D and stereo data - incurs a small speed hit for streams

See Also:
Constant Field Values

FSOUND_HW2D

public static final int FSOUND_HW2D
2D hardware sounds. allows hardware specific effects

See Also:
Constant Field Values

FSOUND_ENABLEFX

public static final int FSOUND_ENABLEFX
Allows DX8 FX to be played back on a sound. Requires DirectX 8 - Note these sounds cannot be played more than once, be 8 bit, be less than a certain size, or have a changing frequency

See Also:
Constant Field Values

FSOUND_MPEGHALFRATE

public static final int FSOUND_MPEGHALFRATE
For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution

See Also:
Constant Field Values

FSOUND_IMAADPCM

public static final int FSOUND_IMAADPCM
Contents are stored compressed as IMA ADPCM

See Also:
Constant Field Values

FSOUND_VAG

public static final int FSOUND_VAG
For PS2 only - Contents are compressed as Sony VAG format

See Also:
Constant Field Values

FSOUND_NONBLOCKING

public static final int FSOUND_NONBLOCKING
For FSOUND_Stream_Open/FMUSIC_LoadSong - Causes stream or music to open in the background and not block the foreground app. See FSOUND_Stream_GetOpenState or FMUSIC_GetOpenState to determine when it IS ready.

See Also:
Constant Field Values

FSOUND_GCADPCM

public static final int FSOUND_GCADPCM
For Gamecube only - Contents are compressed as Gamecube DSP-ADPCM format

See Also:
Constant Field Values

FSOUND_MULTICHANNEL

public static final int FSOUND_MULTICHANNEL
For PS2 and Gamecube only - Contents are interleaved into a multi-channel (more than stereo) format

See Also:
Constant Field Values

FSOUND_USECORE0

public static final int FSOUND_USECORE0
For PS2 only - Sample/Stream is forced to use hardware voices 00-23

See Also:
Constant Field Values

FSOUND_USECORE1

public static final int FSOUND_USECORE1
For PS2 only - Sample/Stream is forced to use hardware voices 24-47

See Also:
Constant Field Values

FSOUND_LOADMEMORYIOP

public static final int FSOUND_LOADMEMORYIOP
For PS2 only - "name" will be interpreted as a pointer to data for streaming and samples. The address provided will be an IOP address

See Also:
Constant Field Values

FSOUND_IGNORETAGS

public static final int FSOUND_IGNORETAGS
Skips id3v2 etc tag checks when opening a stream, to reduce seek/read overhead when opening files (helps with CD performance)

See Also:
Constant Field Values

FSOUND_STREAM_NET

public static final int FSOUND_STREAM_NET
Specifies an internet stream

See Also:
Constant Field Values

FSOUND_NORMAL

public static final int FSOUND_NORMAL
See Also:
Constant Field Values

FSOUND_CD_PLAYCONTINUOUS

public static final int FSOUND_CD_PLAYCONTINUOUS
See Also:
Constant Field Values

FSOUND_CD_PLAYONCE

public static final int FSOUND_CD_PLAYONCE
See Also:
Constant Field Values

FSOUND_CD_PLAYLOOPED

public static final int FSOUND_CD_PLAYLOOPED
See Also:
Constant Field Values

FSOUND_CD_PLAYRANDOM

public static final int FSOUND_CD_PLAYRANDOM
See Also:
Constant Field Values

FSOUND_FREE

public static final int FSOUND_FREE
See Also:
Constant Field Values

FSOUND_UNMANAGED

public static final int FSOUND_UNMANAGED
See Also:
Constant Field Values

FSOUND_ALL

public static final int FSOUND_ALL
See Also:
Constant Field Values

FSOUND_STEREOPAN

public static final int FSOUND_STEREOPAN
See Also:
Constant Field Values

FSOUND_SYSTEMCHANNEL

public static final int FSOUND_SYSTEMCHANNEL
See Also:
Constant Field Values

FSOUND_SYSTEMSAMPLE

public static final int FSOUND_SYSTEMSAMPLE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_DECAYTIMESCALE

public static final int FSOUND_REVERB_FLAGS_DECAYTIMESCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_REFLECTIONSSCALE

public static final int FSOUND_REVERB_FLAGS_REFLECTIONSSCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE

public static final int FSOUND_REVERB_FLAGS_REFLECTIONSDELAYSCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_REVERBSCALE

public static final int FSOUND_REVERB_FLAGS_REVERBSCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_REVERBDELAYSCALE

public static final int FSOUND_REVERB_FLAGS_REVERBDELAYSCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_DECAYHFLIMIT

public static final int FSOUND_REVERB_FLAGS_DECAYHFLIMIT
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_ECHOTIMESCALE

public static final int FSOUND_REVERB_FLAGS_ECHOTIMESCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE

public static final int FSOUND_REVERB_FLAGS_MODULATIONTIMESCALE
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_CORE0

public static final int FSOUND_REVERB_FLAGS_CORE0
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_CORE1

public static final int FSOUND_REVERB_FLAGS_CORE1
See Also:
Constant Field Values

FSOUND_REVERB_FLAGS_DEFAULT

public static final int FSOUND_REVERB_FLAGS_DEFAULT
See Also:
Constant Field Values

FSOUND_TAGFIELD_VORBISCOMMENT

public static final int FSOUND_TAGFIELD_VORBISCOMMENT
A vorbis comment

See Also:
Constant Field Values

FSOUND_TAGFIELD_ID3V1

public static final int FSOUND_TAGFIELD_ID3V1
Part of an ID3v1 tag

See Also:
Constant Field Values

FSOUND_TAGFIELD_ID3V2

public static final int FSOUND_TAGFIELD_ID3V2
An ID3v2 frame

See Also:
Constant Field Values

FSOUND_TAGFIELD_SHOUTCAST

public static final int FSOUND_TAGFIELD_SHOUTCAST
A SHOUTcast header line

See Also:
Constant Field Values

FSOUND_TAGFIELD_ICECAST

public static final int FSOUND_TAGFIELD_ICECAST
An Icecast header line

See Also:
Constant Field Values

FSOUND_TAGFIELD_ASF

public static final int FSOUND_TAGFIELD_ASF
An Advanced Streaming Format header line

See Also:
Constant Field Values

FSOUND_STREAM_NET_NOTCONNECTED

public static final int FSOUND_STREAM_NET_NOTCONNECTED
Stream hasn't connected yet

See Also:
Constant Field Values

FSOUND_STREAM_NET_CONNECTING

public static final int FSOUND_STREAM_NET_CONNECTING
Stream is connecting to remote host

See Also:
Constant Field Values

FSOUND_STREAM_NET_BUFFERING

public static final int FSOUND_STREAM_NET_BUFFERING
Stream is buffering data

See Also:
Constant Field Values

FSOUND_STREAM_NET_READY

public static final int FSOUND_STREAM_NET_READY
Stream is ready to play

See Also:
Constant Field Values

FSOUND_STREAM_NET_ERROR

public static final int FSOUND_STREAM_NET_ERROR
Stream has suffered a fatal error

See Also:
Constant Field Values

FSOUND_FX_CHORUS

public static final int FSOUND_FX_CHORUS
See Also:
Constant Field Values

FSOUND_FX_COMPRESSOR

public static final int FSOUND_FX_COMPRESSOR
See Also:
Constant Field Values

FSOUND_FX_DISTORTION

public static final int FSOUND_FX_DISTORTION
See Also:
Constant Field Values

FSOUND_FX_ECHO

public static final int FSOUND_FX_ECHO
See Also:
Constant Field Values

FSOUND_FX_FLANGER

public static final int FSOUND_FX_FLANGER
See Also:
Constant Field Values

FSOUND_FX_GARGLE

public static final int FSOUND_FX_GARGLE
See Also:
Constant Field Values

FSOUND_FX_I3DL2REVERB

public static final int FSOUND_FX_I3DL2REVERB
See Also:
Constant Field Values

FSOUND_FX_PARAMEQ

public static final int FSOUND_FX_PARAMEQ
See Also:
Constant Field Values

FSOUND_FX_WAVES_REVERB

public static final int FSOUND_FX_WAVES_REVERB
See Also:
Constant Field Values

FSOUND_FX_MAX

public static final int FSOUND_FX_MAX
See Also:
Constant Field Values

FSOUND_SPEAKERMODE_DOLBYDIGITAL

public static final int FSOUND_SPEAKERMODE_DOLBYDIGITAL
Dolby Digital Output (XBOX or PC only).

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_HEADPHONES

public static final int FSOUND_SPEAKERMODE_HEADPHONES
The speakers are headphones.

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_MONO

public static final int FSOUND_SPEAKERMODE_MONO
The speakers are monaural.

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_QUAD

public static final int FSOUND_SPEAKERMODE_QUAD
The speakers are quadraphonic.

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_STEREO

public static final int FSOUND_SPEAKERMODE_STEREO
The speakers are stereo (default value).

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_SURROUND

public static final int FSOUND_SPEAKERMODE_SURROUND
The speakers are surround sound.

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_DTS

public static final int FSOUND_SPEAKERMODE_DTS
DTS output (XBOX only).

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_PROLOGIC2

public static final int FSOUND_SPEAKERMODE_PROLOGIC2
Dolby Prologic 2. Playstation 2 and Gamecube only. PlayStation 2 doesnt support interior panning, but supports 48 voices simultaneously.

See Also:
Constant Field Values

FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR

public static final int FSOUND_SPEAKERMODE_PROLOGIC2_INTERIOR
See Also:
Constant Field Values

FSOUND_INIT_USEDEFAULTMIDISYNTH

public static final int FSOUND_INIT_USEDEFAULTMIDISYNTH
Win32 only - Causes MIDI playback to force software decoding.

See Also:
Constant Field Values

FSOUND_INIT_GLOBALFOCUS

public static final int FSOUND_INIT_GLOBALFOCUS
Win32 only - For DirectSound output - sound is not muted when window is out of focus.

See Also:
Constant Field Values

FSOUND_INIT_ENABLESYSTEMCHANNELFX

public static final int FSOUND_INIT_ENABLESYSTEMCHANNELFX
Win32 only - For DirectSound output - Allows FSOUND_FX api to be used on global software mixer output! (use FSOUND_SYSTEMCHANNEL as channel id)

See Also:
Constant Field Values

FSOUND_INIT_ACCURATEVULEVELS

public static final int FSOUND_INIT_ACCURATEVULEVELS
This latency adjusts FSOUND_GetCurrentLevels, but incurs a small cpu and memory hit

See Also:
Constant Field Values

FSOUND_INIT_PS2_DISABLECORE0REVERB

public static final int FSOUND_INIT_PS2_DISABLECORE0REVERB
PS2 only - Disable reverb on CORE 0 to regain SRAM

See Also:
Constant Field Values

FSOUND_INIT_PS2_DISABLECORE1REVERB

public static final int FSOUND_INIT_PS2_DISABLECORE1REVERB
PS2 only - Disable reverb on CORE 1 to regain SRAM

See Also:
Constant Field Values

FSOUND_INIT_PS2_SWAPDMACORES

public static final int FSOUND_INIT_PS2_SWAPDMACORES
PS2 only - By default FMOD uses DMA CH0 for mixing, CH1 for uploads, this flag swaps them around

See Also:
Constant Field Values

FSOUND_INIT_DONTLATENCYADJUST

public static final int FSOUND_INIT_DONTLATENCYADJUST
Callbacks are not latency adjusted, and are called at mix time. Also information functions are immediate

See Also:
Constant Field Values

FSOUND_INIT_GC_INITLIBS

public static final int FSOUND_INIT_GC_INITLIBS
GC only - Initializes GC audio libraries

See Also:
Constant Field Values

FSOUND_INIT_STREAM_FROM_MAIN_THREAD

public static final int FSOUND_INIT_STREAM_FROM_MAIN_THREAD
Turns off fmod streamer thread, and makes streaming update from FSOUND_Update called by the user

See Also:
Constant Field Values

FSOUND_INIT_PS2_USEVOLUMERAMPING

public static final int FSOUND_INIT_PS2_USEVOLUMERAMPING
PS2 only - Turns on volume ramping system to remove hardware clicks.

See Also:
Constant Field Values

FSOUND_INIT_DSOUND_DEFERRED

public static final int FSOUND_INIT_DSOUND_DEFERRED
Win32 only - For DirectSound output. 3D commands are batched together and executed at FSOUND_Update.

See Also:
Constant Field Values

FSOUND_INIT_DSOUND_HRTF_LIGHT

public static final int FSOUND_INIT_DSOUND_HRTF_LIGHT
Win32 only - For DirectSound output. FSOUND_HW3D buffers use a slightly higher quality algorithm when 3d hardware acceleration is not present.

See Also:
Constant Field Values

FSOUND_INIT_DSOUND_HRTF_FULL

public static final int FSOUND_INIT_DSOUND_HRTF_FULL
Win32 only - For DirectSound output. FSOUND_HW3D buffers use full quality 3d playback when 3d hardware acceleration is not present.

See Also:
Constant Field Values

FSOUND_PROTOCOL_SHOUTCAST

public static final int FSOUND_PROTOCOL_SHOUTCAST
See Also:
Constant Field Values

FSOUND_PROTOCOL_ICECAST

public static final int FSOUND_PROTOCOL_ICECAST
See Also:
Constant Field Values

FSOUND_PROTOCOL_HTTP

public static final int FSOUND_PROTOCOL_HTTP
See Also:
Constant Field Values

FSOUND_FORMAT_MPEG

public static final int FSOUND_FORMAT_MPEG
See Also:
Constant Field Values

FSOUND_FORMAT_OGGVORBIS

public static final int FSOUND_FORMAT_OGGVORBIS
See Also:
Constant Field Values
Constructor Detail

FSound

public FSound()
Method Detail

FSOUND_Close

public static void FSOUND_Close()
Shuts down the WHOLE FMOD Sound System

Remarks This also closes down the sample management system, freeing all MANAGED samples loaded (unless they were allocated with the FSOUND_UNMANAGED flag). Streams are not freed. You must close them yourself. CD Tracks are stopped.


FSOUND_File_SetCallbacks

public static void FSOUND_File_SetCallbacks(FSoundOpenCallback open,
                                            FSoundCloseCallback close,
                                            FSoundReadCallback read,
                                            FSoundSeekCallback seek,
                                            FSoundTellCallback tell)
Specify user callbacks for FMOD's internal file manipulation functions. If ANY of these parameters are NULL, then FMOD will switch back to its own file routines. You can replace this with memory routines (ie name can be cast to a memory address for example, then open sets up a handle based on this information), or alternate file routines, ie a WAD file reader.

Remarks Memory loader FMOD functions are not affected, such as FMUSIC_LoadSongMemory etc. WARNING : This function is dangerous in the wrong hands. You must return the right values, and each command must work properly, or FMOD will not function, or it may even crash if you give it invalid data. You must support SEEK_SET, SEEK_CUR and SEEK_END properly, or FMOD will not work properly. See standard I/O help files on how these work under fseek(). Read the documentation in REMARKS and do exactly what it says. See the "simple" example for how it is used properly. The MIDI loader does not support user file callbacks. For WAD type data structures with embedded MIDI files FMUSIC_LoadSongMemory will have to be used. -------------- PlayStation 2 NOTE! This function takes IOP function pointers, not EE pointers! It is for custom IOP file systems not EE based ones. This function can only be called after FSOUND_Init on PlayStation 2, not before

Parameters:
open - Open callback
close - Close callback
read - Read callback
seek - Seek callback
tell - Tell callback

FSOUND_Init

public static boolean FSOUND_Init(int mixrate,
                                  int channels,
                                  int flags)
Initializes the FMOD Sound System.

Remarks You do not have control over how many hardware channels are available to you. In a lot of cases it may be 0 (the sound card does not have the ability to supply hardware channels). This is why it is usually a good idea to supply FSOUND_Init with a good number of software channels to fall back onto, for example 32. Hardware channels are 3D hardware channels only. There is no benefit in supporting hardware for 2d playback of sound effects. With todays machines and FMOD's superior mixing routines, FMOD's software engine can sometimes be faster than the driver's hardware support!

Parameters:
mixrate - Output rate in hz between 4000 and 65535. Any thing outside this will cause the function to fail and return false. PS2 Note. Only rates of 24000 and 48000 are supported. SmartPhone Note. Use 22050 or the operating system may crash outside of the control of fmod.
channels - Maximum number of SOFTWARE channels available. The number of HARDWARE channels is autodetected. The total number of channels available (hardware and software) after initialization can be found with FSOUND_GetMaxChannels. Having a large number of maxchannels does not adversely affect cpu usage, but it means it has the POTENTIAL to mix a large number of channels, which can have an adverse effect on cpu usage. 1024 is the highest number that can be set. Anything higher will return an error.
flags - See FSOUND_INIT_FLAGS. Controls some global or initialization time aspects of playback
Returns:
On success, true is returned. On failure, false is returned

FSOUND_SetBufferSize

public static boolean FSOUND_SetBufferSize(int len_ms)
Sets the FMOD internal mixing buffer size. It is configurable because low buffersizes use less memory, but are more instable. More importantly, increasing buffer size will increase sound output stability, but on the other hand increases latency, and to some extent, CPU usage. FMOD chooses the most optimal size by default for best stability, depending on the output type - and if the drivers are emulated or not (NT). It is not recommended changing this value unless you really need to. You may get worse performance than the default settings chosen by FMOD.

Remarks This function cannot be called after FMOD is already activated with FSOUND_Init. It must be called before FSOUND_Init, or after FSOUND_Close. --------- The buffersize seting defaults to 50ms if it is not called for DSOUND. It defaults to 200ms for Windows Multimedia wave-out or for emulated DirectSound drivers (such as NT drivers). When the output is FSOUND_OUTPUT_ASIO the buffersize is ignored. The buffersize should be configured using the ASIO driver which can be done with the supplied asioconfig.exe in the FMOD SDK. --------- Buffer sizes lower than 50 are clamped at 50. Buffer sizes are also rounded DOWN to the nearest multiple of 25. This is because FMOD mixes in blocks of 25ms. Due to this buffersize command latency on software channels will be between 25 and 50ms on average (37.5ms) when the buffersize is set to 50. --------- Macintosh, PlayStation 2 and GameCube do not support this as they already achieve minimal latency and are forced to 25ms.

Parameters:
len_ms - buffer size in milliseconds.
Returns:
On success, true is returned. On failure, (ie if FMOD is already active) false is returned

FSOUND_SetDriver

public static boolean FSOUND_SetDriver(int driver)
Selects a soundcard driver. It is used when an output mode has enumerated more than one output device, and you need to select between them.

Remarks This function cannot be called after FMOD is already activated with FSOUND_Init. It must be called before FSOUND_Init, or after FSOUND_Close.

Parameters:
driver - Driver number to select. 0 will select the DEFAULT sound driver. >0 will select an INVALID driver which will case the DEVICE to be set to a null (nosound) driver. <0 Selects other valid drivers that can be listed with FSOUND_GetDriverName.
Returns:
On success, TRUE is returned. On failure, (ie if FMOD is already active) FALSE is returned.

FSOUND_SetMaxHardwareChannels

public static boolean FSOUND_SetMaxHardwareChannels(int max)
This sets the maximum allocatable channels on a hardware card. FMOD automatically detects and allocates the maximum number of 3d hardware channels, so calling this will limit that number if it becomes too much

Remarks This function cannot be called after FMOD is already activated with FSOUND_Init. It must be called before FSOUND_Init, or after FSOUND_Close. --------- This function has nothing to do with FSOUND_SetMinHardwareChannels, in that this is not a function that forces FMOD into software mixing if a card has a certain number of channels. This function only sets a limit on hardware channels, so if you card has 96 hardware channels, and you set FSOUND_SetMaxHardwareChannels(10), then you will only have 10 hardware channels to use.

Parameters:
max - maximum number of hardware channels to allocate, even if the soundcard supports more
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetMinHardwareChannels

public static boolean FSOUND_SetMinHardwareChannels(int min)
This sets the minimum allowable hardware channels before FMOD drops back to 100 percent software. This is helpful for minimum spec cards, and not having to guess how many hardware channels they might have. This way you can guarantee and assume a certain number of channels for your application and place them all in FSOUND_HW3D without fear of the playsound failing because it runs out of channels on a low spec card.

Remarks As an example, if you set your minimum to 16, you can now safely guarantee that 16 sounds can be played at once that are created with FSOUND_HW3D. This way if you do come across a card that only supports 4 channels, it will just drop back to playing ALL sounds in software mode. It may sound worse, but at least it doesnt fail on the playsound. (which could sound even worse!) ---------

Parameters:
min - minimum number of hardware channels allowable on a card before it uses the software engine 1004562604f the time
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetMixer

public static boolean FSOUND_SetMixer(int mixer)
Sets a digital mixer type.

Remarks This function cannot be called after FMOD is already activated with FSOUND_Init. It must be called before FSOUND_Init, or after FSOUND_Close. This function does not nescessarily need to be called, autodetection will select the fastest mixer for your machine. It is here if you need to test all mixer types for debugging purposes, or a mixer has a feature that the autodetected one doesnt. (ie low quality mixers or volume ramping)

Parameters:
mixer - mixer type, see FSOUND_MIXERTYPES for valid parameters and descriptions
Returns:
On success, TRUE is returned. On failure, (ie if FMOD is already active) FALSE is returned

FSOUND_SetOutput

public static boolean FSOUND_SetOutput(int output)
Sets up the soundsystem output mode

Remarks This function cannot be called after FMOD is already activated with FSOUND_Init. It must be called before FSOUND_Init, or after FSOUND_Close. ------- Under Windows NT - Waveout is FASTER than DirectSound, achieves LOWER latency, AND is LESS buggy. DirectSound under NT is achieved by emulating waveout, and therefore is inferior to waveout. Use WAVEOUT under NT. Under Windows 9x and W2K - DirectSound is faster than waveout and can achieve lower latency. Use DIRECTSOUND under Win9x and W2K. ------- If you dont call FSOUND_SetOutput, FMOD will now autodetect DSOUND or WINMM based on the operating system.

Parameters:
output - The output system to be used. See FSOUND_OUTPUTTYPES for valid parameters and descriptions. -1 Is autodetect based on operating system
Returns:
On success, TRUE is returned. On failure, (ie if FMOD is already active) FALSE is returned

FSOUND_SetPanSeperation

public static void FSOUND_SetPanSeperation(float pansep)
Sets the master pan seperation for 2d sound effects

Parameters:
pansep - The pan scalar. 1.0 means full pan seperation, 0 means mono

FSOUND_SetSFXMasterVolume

public static void FSOUND_SetSFXMasterVolume(int volume)
Sets the master volume for any sound effects played. Does not affect music or CD output.

Parameters:
volume - The volume to set. Valid ranges are from 0 (silent) to 255 (full volume)

FSOUND_SetSpeakerMode

public static void FSOUND_SetSpeakerMode(int speakermode)
Sets the mode for the users speaker setup

Remarks Note - Only reliably works with FSOUND_OUTPUT_DSOUND or FSOUND_OUTPUT_XBOX output modes. Other output modes will only interpret FSOUND_SPEAKERMODE_MONO and set everything else to be stereo. ---------------------------------- To get true 5.1 dolby digital or DTS output you will need a soundcard that can encode it, and a receiver that can decode it. If not the results can be unpredictable. ---------------------------------- Calling this will reset the pan separation setting. It sets it to 0 if FSOUND_SPEAKERMODE_MONO is chosen, and 1 otherwise. You will need to reset the pan separation if required afterwards. Note that some soundcard drivers may ignore this call. ---------------------------------- XBOX only - This function MUST be called before FSOUND_Init to change the default speaker mode. To change on the fly, you must close down FMOD with FSOUND_Close then re-initialize it with FSOUND_Init. If it is called after FSOUND_Init, only headphone speakermode is interpreted to switch headphone mode on and off. ---------------------------------- PlayStation 2 only - This function must be called before playing sounds. Calling this after playing a sound will not make that existing sound work in Prologic 2.

Parameters:
speakermode - enum describing the users speaker setup

FSOUND_Update

public static void FSOUND_Update()
This updates the 3d sound engine and DMA engine (only on some platforms), and should be called once a game frame. This function will also update the software mixer if you have selected FSOUND_OUTPUT_NOSOUND_NONREALTIME as your output mode


FSOUND_GetCPUUsage

public static float FSOUND_GetCPUUsage()
Returns in percent of cpu time the amount of cpu usage that FSOUND/FMUSIC mixing is taking

Remarks This value represents the cpu usage used by streams, the software mixer, and subsequent calls to dsound waveout etc. MIDI playback is not counted as it is performed by directx.

Returns:
percent of cpu time the amount of cpu usage that FSOUND/FMUSIC mixing is taking

FSOUND_GetChannelsPlaying

public static int FSOUND_GetChannelsPlaying()
Returns the number of active channels in FSOUND, or ones that are playing

Returns:
number of active channels in FSOUND, or ones that are playing

FSOUND_GetDriver

public static int FSOUND_GetDriver()
Returns the currently selected driver number. Drivers are enumerated when selecting a driver with FSOUND_SetDriver or other driver related functions such as FSOUND_GetNumDrivers or FSOUND_GetDriverName

Returns:
currently selected driver number.

FSOUND_GetDriverCaps

public static boolean FSOUND_GetDriverCaps(int driverid,
                                           java.nio.IntBuffer caps)
Returns information on capabilities of the current output mode

Parameters:
driverid - Enumerated driver ID. This must be in a valid range delimited by FSOUND_GetNumDrivers
caps - IntBuffer to have the caps bits stored
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_GetDriverName

public static java.lang.String FSOUND_GetDriverName(int driverid)
Returns the name of the selected driver. Drivers are enumerated when selecting a driver with FSOUND_SetDriver or other driver related functions such as FSOUND_GetNumDrivers or FSOUND_GetDriver

Remarks If no driver is selected, the default driver is used.

Parameters:
driverid - Enumerated driver ID. This must be in a valid range delimited by FSOUND_GetNumDrivers
Returns:
On success, a String containing the name of the specified device is returned. The number of drivers enumerated can be found with FSOUND_GetNumDrivers. On failure, NULL is returned.

FSOUND_GetError

public static int FSOUND_GetError()
Returns an error code set by FMOD

Returns:
error code, see FMOD_ERRORS

FSOUND_GetMaxSamples

public static int FSOUND_GetMaxSamples()
Returns the current maximum index for a sample. This figure grows as you allocate more samples (in blocks)

Returns:
Maximum sample index

FSOUND_GetMaxChannels

public static int FSOUND_GetMaxChannels()
Returns the total number of channels allocated

Returns:
Number of channels allocated

FSOUND_GetMemoryStats

public static void FSOUND_GetMemoryStats(java.nio.IntBuffer currentallocated_maxallocated)
Returns information on the memory usage of fmod. This is useful for determining a fixed memory size to make FMOD work within for fixed memory machines such as pocketpc and consoles

Remarks Note that if using FSOUND_SetMemorySystem, the memory usage will be slightly higher than without it, as fmod has to have a small amount of memory overhead to manage the available memory.

Parameters:
currentallocated_maxallocated - IntBuffer to store Currently allocated memory at time of call and Maximum allocated memory since FSOUND_Init or FSOUND_SetMemorySystem

FSOUND_GetNumDrivers

public static int FSOUND_GetNumDrivers()
Returns the number of sound cards or devices enumerated for the current output type. (Direct Sound, WaveOut etc

Returns:
Total number of enumerated sound devices

FSOUND_GetNumHWChannels

public static boolean FSOUND_GetNumHWChannels(java.nio.IntBuffer twoD_threeD_channels_total)
Returns the number of available hardware mixed 2d and 3d channels

Parameters:
twoD_threeD_channels_total - IntBuffer to store number of available hardware mixed 2d channels, number of available hardware mixed 3d channels and the total (Usually num2d + num3d, but on some platforms like PS2 and GameCube, this will be the same as num2d and num3d (and not the sum) because 2d and 3d voices share the same pool)
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_GetOutput

public static int FSOUND_GetOutput()
Returns the current id to the output type. See FSOUND_OUTPUTTYPES for valid parameters and descriptions

Returns:
id to output type

FSOUND_GetOutputRate

public static int FSOUND_GetOutputRate()
Returns the current mixing rate

Returns:
Currently set output rate in Hz

FSOUND_GetSFXMasterVolume

public static int FSOUND_GetSFXMasterVolume()
Returns the master volume for any sound effects played. It specifically has SFX in the function name, as it does not affect music or CD volume. This must also be altered with FMUSIC_SetMasterVolume

Returns:
On success, the SFX master volume is returned. Valid ranges are from 0 (silent) to 255 (full volume)

FSOUND_GetVersion

public static float FSOUND_GetVersion()
Returns the FMOD version number

Remarks Use this to compare the header you are using against the compiled DLL version to make sure your DLL is up to date.

Returns:
FMOD version number

FSOUND_Sample_Alloc

public static FSoundSample FSOUND_Sample_Alloc(int index,
                                               int length,
                                               int mode,
                                               int deffreq,
                                               int defvol,
                                               int defpan,
                                               int defpri)
Allocates a new empty sample. Used if you want to create a sample from scratch and fill the databuffer with your own data (using FSOUND_Sample_Lock or FSOUND_Sample_Upload), instead of just loading a file with FSOUND_Sample_Load.

Remarks FMOD has a sample management system that holds onto any samples loaded or allocated, and frees them all when you call FSOUND_Close. It takes the hassle out of having to keep hold of a lot of sample handles and remember to free them all at the end of your application. It is basically an expandle array of handles that holds each sample until FMOD closes down where it does a cleanup. FSOUND_UNMANAGED can be used NOT to use the sample management system. ------------ FSOUND_Sample_Alloc is only nescessary for lower level operations with sample data. Usually FSOUND_Load does the work for you. lower level operations mean such things as uploading data from memory or your own compressed data for example. You can create a new sample from scratch by doing the following operations 1. Allocate a new sample with FSOUND_Sample_Alloc 2. Write data to the sample buffer with FSOUND_Sample_Lock and FSOUND_Sample_Unlock, or FSOUND_Sample_Upload. Note FSOUND_Sample_Lock only returns a pointer to the sample data, whereas FSOUND_Sample_Upload does a copy from data you give it, with format conversion to the correct format.

Parameters:
index - Sample pool index. See remarks for more on the sample pool. 0 or above - The absolute index into fsounds sample pool. The pool will grow as the index gets larger. If a slot is already used it will be replaced. FSOUND_FREE - Let FSOUND select an arbitrary sample slot. FSOUND_UNMANAGED - Dont have fsound free this sample upon FSOUND_Close
length - The length in of the sample buffer in SAMPLES
mode - Bitfield describing various characteristics of the sample. Valid parameters are described in FSOUND_MODES
deffreq - Default frequency for this sample
defvol - Default volume for this sample
defpan - Default pan for this sample
defpri - Default priority for this sample
Returns:
On success, a reference to an allocated sample is returned. On failure, NULL is returned

FSOUND_Sample_Free

public static void FSOUND_Sample_Free(FSoundSample sample)
Removes a sample from memory and makes its slot available again

Parameters:
sample - sample definition to be freed

FSOUND_Sample_Get

public static FSoundSample FSOUND_Sample_Get(int sampno)
Returns a reference to a managed sample based on the index passed

Remarks Samples that are not created with FSOUND_UNMANAGED are stored in a table inside FMOD. This way when FMOD can free all samples when FSOUND_Close is called and the user doesnt have to worry about cleaning up memory.

Parameters:
sampno - index in the sample management pool of the requested sample
Returns:
Reference to a sample

FSOUND_Sample_GetDefaults

public static boolean FSOUND_Sample_GetDefaults(FSoundSample sample,
                                                java.nio.IntBuffer deffreq,
                                                java.nio.IntBuffer defvol,
                                                java.nio.IntBuffer defpan,
                                                java.nio.IntBuffer defpri)
Returns the default volume, frequency, pan and priority values for the specified sample

Remarks Passing NULL in any of these parameters will result in the value being ignored

Parameters:
sample - sample to get the default information from
deffreq - IntBuffer to be filled with the sample default frequency. Can be NULL
defvol - IntBuffer to be filled with the sample default volume. Can be NULL
defpan - IntBuffer to be filled with the sample default pan. Can be NULL
defpri - IntBuffer to be filled with the sample default priority. Can be NULL
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Sample_GetDefaultsEx

public static boolean FSOUND_Sample_GetDefaultsEx(FSoundSample sample,
                                                  java.nio.IntBuffer deffreq,
                                                  java.nio.IntBuffer defvol,
                                                  java.nio.IntBuffer defpan,
                                                  java.nio.IntBuffer defpri,
                                                  java.nio.IntBuffer varfreq,
                                                  java.nio.IntBuffer varvol,
                                                  java.nio.IntBuffer varpan)
Returns the default volume, frequency, pan, priority and random playback variations for the specified sample

Remarks Passing NULL in any of these parameters will result in the value being ignored

Parameters:
sample - sample to get the default information from
deffreq - IntBuffer to be filled with the sample default frequency. Can be NULL
defvol - IntBuffer to be filled with the sample default volume. Can be NULL
defpan - IntBuffer to be filled with the sample default pan. Can be NULL
defpri - IntBuffer to be filled with the sample default priority. Can be NULL
varfreq - IntBuffer to be filled with the sample random frequency variance. Can be NULL
varvol - IntBuffer to be filled with the sample random volume variance. Can be NULL
varpan - IntBuffer to be filled with the sample random pan variance. Can be NULL.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Sample_GetLength

public static int FSOUND_Sample_GetLength(FSoundSample sample)
Returns the length of the sample in SAMPLES

Parameters:
sample - sample to get the length from
Returns:
On success, the length of sample in SAMPLES is returned. On failure, 0 is returned

FSOUND_Sample_GetLoopPoints

public static int FSOUND_Sample_GetLoopPoints(FSoundSample sample,
                                              java.nio.IntBuffer loopstart,
                                              java.nio.IntBuffer loopend)
Returns the start and end positions of the specified sample loop in SAMPLES (not bytes)

Remarks Passing NULL in any of these parameters will result in the value being ignored.

Parameters:
sample - sample to get the loop point information from
loopstart - IntBuffer to be filled with the sample loop start point. Can be NULL
loopend - IntBuffer to be filled with the sample loop end point. Can be NULL
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Sample_GetMinMaxDistance

public static int FSOUND_Sample_GetMinMaxDistance(FSoundSample sample,
                                                  java.nio.FloatBuffer min,
                                                  java.nio.FloatBuffer max)
Get the minimum and maximum audible distance for a sample

Remarks A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. The default units for minimum and maximum distances are 1.0 and 1000000000.0f. Volume drops off at mindistance / distance.

Parameters:
sample - sample to get the distance information from
min - FloatBuffer to be filled with the sample loop start point. Can be NULL
max - FloatBuffer to be filled with the sample loop end point. Can be NULL
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Sample_GetMode

public static int FSOUND_Sample_GetMode(FSoundSample sample)
Returns a bitfield containing information about the specified sample. The values can be bitwise AND'ed with the values contained in FSOUND_MODES to see if certain criteria are true or not. Information that can be retrieved from the same in this field are loop type, bitdepth and stereo/mono.

Parameters:
sample - sample to get the mode information from
Returns:
On success, the sample mode is returned. On failure, 0 is returned.

FSOUND_Sample_GetName

public static java.lang.String FSOUND_Sample_GetName(FSoundSample sample)
Returns a string containing the sample's name

Parameters:
sample - sample to get the loop point information from
Returns:
On success, the name of the sample is returned. On failure, NULL is returned.

FSOUND_Sample_Load

public static FSoundSample FSOUND_Sample_Load(int index,
                                              java.nio.ByteBuffer data,
                                              int inputmode)
Loads and decodes a static soundfile into memory. This includes such files as .WAV, .MP2, .MP3, .OGG, .RAW and others.

Remarks FMOD has a sample management system that holds onto any samples loaded or allocated, and frees them all when you call FSOUND_Close. It takes the hassle out of having to keep hold of a lot of sample handles and remember to free them all at the end of your application. It is basically an expandle array of handles that holds each sample until FMOD closes down where it does a cleanup. FSOUND_UNMANAGED can be used so FMOD does NOT use the sample management system. You have to make sure they are freed yourself. -------- Specify FSOUND_LOADMEMORY to load a file from a memory image. The pointer you pass to name must be the actual image of the data you want to load. The length parameter is to be filled out if FSOUND_LOADMEMORY is specified, otherwise if you do not specify memory loading, can be safely ignored and should be set to 0. -------- Compressed formats are expanded into memory. If the file is quite large, it could take a while to load. -------- If FSOUND_8BITS is specified and the file decodes to 16bit normally, FMOD will downgrade the sample to 8bit. -------- On PlayStation 2, the name_or_data pointer and length variables must be 16 byte aligned, for DMA reasons. -------- Note that FSOUND_NONBLOCKING is NOT supported with this function.

Parameters:
index - Sample pool index. See remarks for more on the sample pool. 0 or above - The absolute index into the sample pool. The pool will grow as the index gets larger. If a slot is already used it will be replaced. FSOUND_FREE - Let FSOUND select an arbitrary sample slot. FSOUND_UNMANAGED - Dont have this sample managed within fsounds sample management system
data - ByteBuffer of memory image to load.
inputmode - Description of the data format, OR in the bits defined in FSOUND_MODES to describe the data being loaded.
Returns:
On success, a sample is returned. On failure, NULL is returned.

FSOUND_Sample_Load

public static FSoundSample FSOUND_Sample_Load(int index,
                                              java.lang.String name,
                                              int inputmode,
                                              int offset,
                                              int length)
Parameters:
index - Sample pool index. See remarks for more on the sample pool. 0 or above - The absolute index into the sample pool. The pool will grow as the index gets larger. If a slot is already used it will be replaced. FSOUND_FREE - Let FSOUND select an arbitrary sample slot. FSOUND_UNMANAGED - Dont have this sample managed within fsounds sample management system
name - Name of sound file.
inputmode - Description of the data format, OR in the bits defined in FSOUND_MODES to describe the data being loaded.
offset - Optional. 0 by default. If > 0, this value is used to specify an offset in a file, so fmod will seek before opening. length must also be specified if this value is used.
length - Optional. 0 by default. If > 0, this value is used to specify the length of a memory block when using FSOUND_LOADMEMORY, or it is the length of a file or file segment if the offset parameter is used. On PlayStation 2 this must be 16 byte aligned for memory loading.
Returns:
On success, a sample is returned. On failure, NULL is returned.
See Also:
#FSOUND_Sample_Load(int, ByteBuffer, int, int, int)

FSOUND_Sample_Lock

public static boolean FSOUND_Sample_Lock(FSoundSample sample,
                                         int offset,
                                         int length,
                                         FSoundSampleLock lock)
Returns a reference to the beginning of the sample data for a sample. Data written must be signed. NOTE: This method creates 2 direct buffers on the native side, that maps to the sample data. Calling this method excessively might hurt performance.

Remarks You must always unlock the data again after you have finished with it, using FSOUND_Sample_Unlock. For PCM based samples, data must be signed 8 or 16bit. For compressed samples such as those created with FSOUND_IMAADPCM, FSOUND_VAG, FSOUND_GCADPCM, the data must be in its original compressed format. On PlayStation 2, with FSOUND_HW2D or FSOUND_HW3D based samples, this function does not return a readable or writable buffer, it returns the SPU2 address of the sample. To send data to it you must call FSOUND_SendData. On GameCube, with FSOUND_HW2D or FSOUND_HW3D based samples, this function will not return the data contained within the sample. It is for upload purposes only.

Parameters:
sample - sample definition
offset - Offset in BYTES to the position you want to lock in the sample buffer.
length - Number of BYTES you want to lock in the sample buffer.
lock - lock object to contain lock info
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_SetDefaults

public static boolean FSOUND_Sample_SetDefaults(FSoundSample sample,
                                                int deffreq,
                                                int defvol,
                                                int defpan,
                                                int defpri)
Sets a sample's default attributes, so when it is played it uses these values without having to specify them later.

Parameters:
sample - sample to have its attributes set
deffreq - Default sample frequency. The value here is specified in hz. -1 to ignore.
defvol - Default sample volume. This is a value from 0 to 255. -1 to ignore.
defpan - Default sample pan position. This is a value from 0 to 255 or FSOUND_STEREOPAN.
defpri - Default sample priority. This is a value from 0 to 255. -1 to ignore.
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_SetDefaultsEx

public static boolean FSOUND_Sample_SetDefaultsEx(FSoundSample sample,
                                                  int deffreq,
                                                  int defvol,
                                                  int defpan,
                                                  int defpri,
                                                  int varfreq,
                                                  int varvol,
                                                  int varpan)
Sets a sample's default attributes, so when it is played it uses these values without having to specify them later.

Remarks Frequency, volume and pan variation values specify a +/- variation to the specified default frequency, volume and pan values i.e. with deffreq=44100, varfreq=2000 the actual frequency value used will be in the range 42100 -> 46100.

Parameters:
sample - sample to have its attributes set
deffreq - Default sample frequency. The value here is specified in hz. -1 to ignore.
defvol - Default sample volume. This is a value from 0 to 255. -1 to ignore.
defpan - Default sample pan position. This is a value from 0 to 255 or FSOUND_STEREOPAN.
defpri - Default sample priority. This is a value from 0 to 255. -1 to ignore.
varfreq - Frequency variation in hz to apply to deffreq each time this sample is played. -1 to ignore.
varvol - Volume variation to apply to defvol each time this sample is played. -1 to ignore.
varpan - Pan variation to apply to defpan each time this sample is played. -1 to ignore.
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_SetMaxPlaybacks

public static boolean FSOUND_Sample_SetMaxPlaybacks(FSoundSample sample,
                                                    int max)
Sets the maximum number of times a sample can play back at once

Parameters:
sample - sample to have its playback behaviour changed
max - maximum number of times a sample can play back at once
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_SetMinMaxDistance

public static boolean FSOUND_Sample_SetMinMaxDistance(FSoundSample sample,
                                                      float min,
                                                      float max)
Sets the minimum and maximum audible distance for a sample. MinDistance is the minimum distance that the sound emitter will cease to continue growing louder at (as it approaches the listener). Within the mindistance it stays at the constant loudest volume possible. Outside of this mindistance it begins to attenuate. MaxDistance is the distance a sound stops attenuating at. Beyond this point it will stay at the volume it would be at maxdistance units from the listener and will not attenuate any more. MinDistance is useful to give the impression that the sound is loud or soft in 3d space. An example of this is a small quiet object, such as a bumblebee, which you could set a mindistance of to 0.1 for example, which would cause it to attenuate quickly and dissapear when only a few meters away from the listener. Another example is a jumbo jet, which you could set to a mindistance of 100.0, which would keep the sound volume at max until the listener was 100 meters away, then it would be hundreds of meters more before it would fade out. ------- In summary, increase the mindistance of a sound to make it 'louder' in a 3d world, and decrease it to make it 'quieter' in a 3d world. maxdistance is effectively obsolete unless you need the sound to stop fading out at a certain point. Do not adjust this from the default if you dont need to. Some people have the confusion that maxdistance is the point the sound will fade out to, this is not the case

Remarks A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. The default units for minimum and maximum distances are 1.0 and 1000000000.0f. Volume drops off at mindistance / distance.

Parameters:
sample - sample to have its minimum and maximum distance set
min - The samples minimum volume distance in "units". See remarks for more on units.
max - The samples maximum volume distance in "units". See remarks for more on units.
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_SetMode

public static boolean FSOUND_Sample_SetMode(FSoundSample sample,
                                            int mode)
Sets a sample's mode. This can only be FSOUND_LOOP_OFF,FSOUND_LOOP_NORMAL, FSOUND_LOOP_BIDI or FSOUND_2D. You cannot change the description of the contents of a sample or its location. FSOUND_2D will be ignored on the Win32 platform if FSOUND_HW3D was used to create the sample.

Remarks Only the following modes are accepted, others will be filtered out. FSOUND_LOOP_BIDI, FSOUND_LOOP_NORMAL, FSOUND_LOOP_OFF, FSOUND_2D. Normally FSOUND_2D is accepted only if the sound is software mixed. If this is not set, the mode is set for the sample to be 3D processed. ------------------- On Playstation 2, XBox and GameCube, FSOUND_HW2D and FSOUND_HW3D are supported, so you can change between the 2 at runtime. ------------------- On Windows, samples created with FSOUND_HW3D or FSOUND_HW2D do not support FSOUND_LOOP_BIDI. This is a limitation of Direct X. *

Parameters:
sample - sample to have the mode set
mode - mode bits to set from FSOUND_MODES
Returns:
On success, true is is returned. On failure, false is returned.

nFSOUND_Sample_SetLoopPoints

public static boolean nFSOUND_Sample_SetLoopPoints(FSoundSample sample,
                                                   int loopstart,
                                                   int loopend)
Sets a sample's loop points, specified in SAMPLES, not bytes

Remarks Samples created with FSOUND_HW3D and FSOUND_HW2D under the FSOUND_OUTPUT_DSOUND output mode do not support this function. Loop points set on such a sample with be ignored, and the sample will loop in its entirety. This is a limitation of DirectSound. On XBOX, GameCube and Playstation 2 hardware voices using compressed data (ie XADPCM, VAG or GCADPCM), these values will not be sample accurate, but will be rounded to the nearest compression block size. On PlayStation 2, the loopend is ignored. The hardware cannot change the end address, so the loopend is always equivalent to length - 1 no matter what you set. *

Parameters:
sample - sample to have its loop points set
loopstart - The starting position of the sample loop
loopend - The end position of the sample loop
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_Unlock

public static boolean FSOUND_Sample_Unlock(FSoundSample sample,
                                           FSoundSampleLock lock)
Releases previous sample data lock from FSOUND_Sample_Lock

Parameters:
sample - sample definition
lock - lock object that contains lock info
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_Sample_Upload

public static boolean FSOUND_Sample_Upload(FSoundSample sample,
                                           java.nio.ByteBuffer srcdata,
                                           int mode)
This function uploads new sound data from memory to a preallocated/existing sample and does conversion based on the specified source mode. If sample data already exists at this handle then it is replaced with the new data being uploaded

Remarks Note that on PlayStation 2 the source data address is an IOP address not an EE address. To get data from EE RAM to the sample you must allocate some IOP memory, dma it to IOP memory then call upload. There are helper functions in fmodps2.h to achieve this.

Parameters:
sample - the destination sample
srcdata - ByteBuffer to the source data to be uploaded. On PlayStation 2 this is an IOP address not an EE address.
mode - Description of the source data format. Bitwise OR in these bits to describe the data being passed in. See FSOUND_MODES for valid parameters and descriptions. FSOUND_HW3D, FSOUND_HW2D and FSOUND_LOOP modes are ignored, the mode describes the source format, not the destination format.
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_PlaySound

public static int FSOUND_PlaySound(int channel,
                                   FSoundSample sample)
Plays a sample in a specified channel, using the sample's default frequency, volume and pan settings.

Remarks If you play a FSOUND_HW3D declared sample with this function, then the position and velocity are set to those of the listener. Other attributes such as volume, frequency and pan are taken from the sample's default volume, frequency, pan etc. ---------- The channel handle : The return value is reference counted. This stops the user from updating a stolen channel. Basically it means the only sound you can change the attributes (ie volume/pan/frequency/3d position) for are the one you specifically called playsound for. If another sound steals that channel, and you keep trying to change its attributes (ie volume/pan/frequency/3d position), it will do nothing. This is great if you have sounds being updated from tasks and you just forget about it. You can keep updating the sound attributes and if another task steals that channel, your original task wont change the attributes of the new sound!!! The lower 12 bits contain the channel number. (yes this means a 4096 channel limit for FMOD :) The upper 19 bits contain the reference count. The top 1 bit is the sign bit. ie S RRRRRRRRRRRRRRRRRRR CCCCCCCCCCCC ---------- Remember if not using FSOUND_FREE, then the channel pool is split up into software and hardware channels. Software channels occupy the first n indicies specified by the value passed into FSOUND_Init. Hardware channels occupy the next n indicies after this, and can be a variable amount, depending on the hardware. Use FSOUND_GetNumHardwareChannels to query how many channels are available in hardware.

Parameters:
channel - 0+ The absolute channel number in the channel pool. Remember software channels come first, followed by hardware channels. You cannot play a software sample on a hardware channel and vice versa. FSOUND_FREE Chooses a free channel to play in. If all channels are used then it selects a channel with a sample playing that has an EQUAL or LOWER priority than the sample to be played. FSOUND_ALL Passing this will cause ALL channels to play. (note this will make things VERY noisy!) If FSOUND_ALL is used the last channel success flag will be returned.
sample - to be played
Returns:
On success, the channel handle that was selected is returned. On failure, -1 is returned.

nFSOUND_PlaySoundEx

public static int nFSOUND_PlaySoundEx(int channel,
                                      FSoundSample sample,
                                      FSoundDSPUnit dspunit,
                                      boolean startpaused)
Extended featured version of FSOUND_PlaySound. New functionality includes the ability to start the sound paused. This allows attributes of a channel to be set freely before the sound actually starts playing, until FSOUND_SetPaused(FALSE) is used. Also added is the ability to associate the channel to a specified DSP unit. This allows the user to 'group' channels into seperate DSP units, which allows effects to be inserted between these 'groups', and allow various things like having one group affected by reverb (wet mix) and another group of channels unaffected (dry). This is useful to seperate things like music from being affected by DSP effects, while other sound effects are.

Remarks FSOUND_ALL is supported. Passing this will cause ALL channels to play. (note this could make things VERY noisy!) If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. ---------- The channel handle : The return value is reference counted. This stops the user from updating a stolen channel. This means the only sound you can change the attributes (ie volume/pan/frequency/3d position) for are the one you specifically called playsound for. If another sound steals that channel, and you keep trying to change its attributes (ie volume/pan/frequency/3d position), it will do nothing. This is great if you have sounds being updated from tasks and you just forget about it. You can keep updating the sound attributes and if another task steals that channel, your original task wont change the attributes of the new sound!!! The lower 12 bits contain the channel number. (yes this means a 4096 channel limit for FMOD :) The upper 19 bits contain the reference count. The top 1 bit is the sign bit. ie S RRRRRRRRRRRRRRRRRRR CCCCCCCCCCCC ---------- Remember if not using FSOUND_FREE, then the channel pool is split up into software and hardware channels. Software channels occupy the first n indicies specified by the value passed into FSOUND_Init. Hardware channels occupy the next n indicies after this, and can be a variable amount, depending on the hardware. Use FSOUND_GetNumHardwareChannels to query how many channels are available in hardware. ---------- If you attach a sound to a DSP unit (for grouping purposes), the callback for the DSP unit will be overwritten with fmod's internal mixer callback, so the callback the user supplied is rendered obsolete and is not called. Also, do not attach sounds to system DSP units, the assignment will be ignored if you do.

Parameters:
channel - 0+ The absolute channel number in the channel pool. Remember software channels come first, followed by hardware channels. You cannot play a software sample on a hardware channel and vice versa. FSOUND_FREE Chooses a free channel to play in. If all channels are used then it selects a channel with a sample playing that has an EQUAL or LOWER priority than the sample to be played. FSOUND_ALL Passing this will cause ALL channels to play. (note this will make things VERY noisy!) If FSOUND_ALL is used the last channel success flag will be returned.
sample - to be played
dspunit - Optional. NULL by default. Pointer to a dsp unit to attach the channel to for channel grouping. Only attach a sound to a user created DSP unit, and not a system DSP unit.
startpaused - Start the sound paused or not. Pausing the sound allows attributes to be set before the sound starts
Returns:
On success, the channel handle that was selected is returned. On failure, -1 is returned.

FSOUND_StopSound

public static boolean FSOUND_StopSound(int channel)
Stops a specified sound channel from playing, and frees it up for re-use

Remarks FSOUND_ALL is supported. Passing this will cause ALL channels to stop. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to stop. FSOUND_ALL can also be used (see remarks)
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetFrequency

public static boolean FSOUND_SetFrequency(int channel,
                                          int freq)
Sets a channels frequency or playback rate, in Hz.

Remarks FSOUND_ALL is supported here. Passing this will set ALL channels to specified frequency. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. Negative frequencies make the sound play backwards, so FSOUND_SetCurrentPosition would be needed to set the sound to the right position.

Parameters:
channel - The channel number/handle to stop. FSOUND_ALL can also be used (see remarks)
freq - The frequency to set. Valid ranges are from 100 to 705600, and -100 to -705600
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetLevels

public static boolean FSOUND_SetLevels(int channel,
                                       int frontleft,
                                       int center,
                                       int frontright,
                                       int backleft,
                                       int backright,
                                       int lfe)
XBox Only - For surround sound systems, this function allows each surround speaker level to be set individually for this channel

Remarks FSOUND_ALL is supported. Passing this will set the pan of ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. ---------- FSOUND_SYSTEMCHANNEL is supported. You can set the mix levels for the FMOD software engine, and ALL software mixed sounds will be affected. *

Parameters:
channel - The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks)
frontleft - Value from 0 to 255 inclusive, specifying a linear level for the front left speaker.
center - Value from 0 to 255 inclusive, specifying a linear level for the center.
frontright - Value from 0 to 255 inclusive, specifying a linear level for the front right speaker.
backleft - Value from 0 to 255 inclusive, specifying a linear level for the back left speaker.
backright - Value from 0 to 255 inclusive, specifying a linear level for the back right speaker.
lfe - Value from 0 to 255 inclusive, specifying a linear level for the subwoofer speaker.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetLoopMode

public static boolean FSOUND_SetLoopMode(int channel,
                                         int loopmode)
Sets the loop mode for a particular CHANNEL, not sample

Remarks FSOUND_ALL is supported. Passing this will set loop modes for all channels available. Note, this does not work for hardware sounds played on hardware channels while they are playing. The function has to be called when the channel is paused. Software based sounds do not have this limitation, and can have their loop mode changed during playback, but for compatibility it is best to use the pause method, else you may get different behaviour if hardware voices do not exist.

Parameters:
channel - The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks)
loopmode - The loopmode to set. This can be FSOUND_LOOP_NORMAL, FSOUND_LOOP_BIDI or FSOUND_LOOP_OFF.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetMute

public static boolean FSOUND_SetMute(int channel,
                                     boolean mute)
Mutes and un-mutes a channel

Remarks FSOUND_ALL is supported. Passing this will mute/unmute ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks)
mute - Toggle value - TRUE mutes out the channel, FALSE reenables it.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetPan

public static boolean FSOUND_SetPan(int channel,
                                    int pan)
Sets a channels pan position linearly

Remarks FSOUND_ALL is supported. Passing this will set the pan of ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. ---------- Important : If you are playing a STEREO sample, and using normal middle panning, it will only come out at half the volume they are supposed to. To avoid this use FSOUND_STEREO pan. Panning works in the following manner: full left : 100to left, 0to right full right : 0to left, 100to right middle : 71to left, 71to right FMOD Uses 'constant power' panning. The center position is 71 4738960n each channel as it keeps an even RMS output level when moving the sound from left to right. Placing 50 4738960n each channel for a middle position is incorrect. The pan graph for constant power panning resembles a curve instead of straight lines. *

Parameters:
channel - The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks)
pan - The panning position for this channel to set. parameters are: - from 0 (full left) to 255 (full right) - FSOUND_STEREOPAN. This is meant for stereo samples, but will work on mono samples as well. It makes both left and right FULL volume instead of 50/50 as middle panning does. See remarks section for more information on this
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetPaused

public static boolean FSOUND_SetPaused(int channel,
                                       boolean paused)
Pauses or unpauses a sound channel

Remarks FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks)
paused - TRUE pauses this channel, FALSE unpauses it.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetPriority

public static boolean FSOUND_SetPriority(int channel,
                                         int priority)
Sets a channels priority. Higher priority means it is less likely to get discarded when FSOUND_FREE is used to select a channel, when all channels are being used, and one has to be rejected. If a channel has an equal priority then it will be replaced.

Remarks FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to change the output levels for. FSOUND_ALL and FSOUND_SYSTEMCHANNEL can also be used (see remarks)
priority - The priority to set. Valid ranges are from 0 (lowest) to 255 (highest)
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetReserved

public static boolean FSOUND_SetReserved(int channel,
                                         boolean reserved)
This sets the reserved status of a channel. Reserving a channel is related to setting its priority, but reserving a channel means it can NEVER be stolen by a channel request. It could be thought of as an extra high priority, but is different in that reserved channels do not steal from each other, whereas channels with equal priorities do (unless there are channels with lower priorities that it can steal from). If all channels were reserved and another request for came in for a channel, it would simply fail and the sound would not be played.

Remarks FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to change the priority for. FSOUND_ALL can also be used (see remarks). FSOUND_FREE is NOT accepted.
reserved - Reserved flag. Values accepted are TRUE, to reserve a channel, and FALSE to un-reserve a channel.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetSurround

public static boolean FSOUND_SetSurround(int channel,
                                         boolean surround)
Sets a channels surround sound status. This surround sound is a fake dolby trick that effectively pans the channel to the center, but inverts the waveform in one speaker to make it sound fuller or spacier, or like it is coming out of space between the 2 speakers. Panning is ignored while surround is in effect.

Remarks FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to change the surround for. FSOUND_ALL can also be used (see remarks).
surround - Toggle value - TRUE enables surround sound on the channel, FALSE disables it.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetVolume

public static boolean FSOUND_SetVolume(int channel,
                                       int vol)
Sets a channels volume linearly. This function IS affected by FSOUND_SetSFXMasterVolume.

Remarks FSOUND_ALL is supported. Passing this will pause/unpause ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances.

Parameters:
channel - The channel number/handle to change the volume for. FSOUND_ALL can also be used (see remarks)
vol - The volume to set. Valid ranges are from 0 (silent) to 255 (full volume)
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_SetVolumeAbsolute

public static boolean FSOUND_SetVolumeAbsolute(int channel,
                                               int vol)
Sets a channels volume linearly. This function is NOT affected by master volume. This function is used when you want to quiet everything down using FSOUND_SetSFXMasterVolume, but make a channel prominent.

Remarks FSOUND_ALL is supported. Passing this will set the absolute volume of ALL channels available. If FSOUND_ALL is used the last channel success flag will be returned. This return value is not useful in most circumstances. ------------- A good example of this function being used for a game needing a voice over. If all the background sounds were too loud and drowned out the voice over, there is no way to feasibly go through all the sfx channels and lower the background noise volumes (some might be allocated by music). Simply lower the background noise with FSOUND_SetSFXMasterVolume, and use FSOUND_SetVolumeAbsolute to bring up the volume of the voice over to full, and you will get one channel standing out amongst the rest. *

Parameters:
channel - The channel number/handle to change the volume for. FSOUND_ALL can also be used (see remarks)
vol - The volume to set. Valid ranges are from 0 (silent) to 255 (full volume)
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_GetVolume

public static int FSOUND_GetVolume(int channel)
Returns the linear volume of the specified channel between 0 and 255

Parameters:
channel - Channel to get volume from
Returns:
On success, the following values are returned : 0 = silent to 255 = full volume. On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError.

FSOUND_GetAmplitude

public static int FSOUND_GetAmplitude(int channel)
Returns the volume of the channel based on all combinations of set volume, mastervolume and 3d position. Works on software and hardware voices.

Remarks This is not the same as FSOUND_GetCurrentLevels, as that function takes the actual waveform data into account. This function simply gives a final volume based on 3d position and volume settings.

Parameters:
channel - Channel to get amplitude from
Returns:
On success, the following values are returned : 0 = silent to 255 = full volume. On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError.

FSOUND_3D_SetAttributes

public static boolean FSOUND_3D_SetAttributes(int channel,
                                              java.nio.FloatBuffer pos,
                                              java.nio.FloatBuffer vel)
This updates the position and velocity of a 3d sound playing on a channel

Remarks FSOUND treats +X as right, +Y as up, and +Z as forwards. --------- A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. --------- FSOUND vectors expect 3 floats representing x y and z in that order. I.e. a typical definition

Parameters:
channel - Channel you want to apply 3d positioning to.
pos - Pointer to a position vector (xyz float triplet) of the emitter in world space, measured in distance units. This can be NULL to ignore it.
vel - Pointer to a velocity vector (xyz float triplet), of the emitter measured in distance units PER SECOND. This can be NULL to ignore it.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_3D_SetMinMaxDistance

public static boolean FSOUND_3D_SetMinMaxDistance(int channel,
                                                  float min,
                                                  float max)
Sets the minimum and maximum audible distance for a channel. MinDistance is the minimum distance that the sound emitter will cease to continue growing louder at (as it approaches the listener). Within the mindistance it stays at the constant loudest volume possible. Outside of this mindistance it begins to attenuate. MaxDistance is the distance a sound stops attenuating at. Beyond this point it will stay at the volume it would be at maxdistance units from the listener and will not attenuate any more. MinDistance is useful to give the impression that the sound is loud or soft in 3d space. An example of this is a small quiet object, such as a bumblebee, which you could set a mindistance of to 0.1 for example, which would cause it to attenuate quickly and dissapear when only a few meters away from the listener. Another example is a jumbo jet, which you could set to a mindistance of 100.0, which would keep the sound volume at max until the listener was 100 meters away, then it would be hundreds of meters more before it would fade out. ------- In summary, increase the mindistance of a sound to make it 'louder' in a 3d world, and decrease it to make it 'quieter' in a 3d world. maxdistance is effectively obsolete unless you need the sound to stop fading out at a certain point. Do not adjust this from the default if you dont need to. Some people have the confusion that maxdistance is the point the sound will fade out to, this is not the case.

Remarks FSOUND_ALL is supported. Passing this will set the min/max distance on ALL channels available. A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. The default units for minimum and maximum distances are 1.0 and 1000000000.0f. Volume drops off at mindistance / distance. To define the min and max distance per sound and not per channel use FSOUND_Sample_SetMinMaxDistance.

Parameters:
channel - The channel to have its minimum and maximum distance set.
min - The channels minimum volume distance in "units". See remarks for more on units.
max - The channels maximum volume distance in "units". See remarks for more on units.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_SetCurrentPosition

public static boolean FSOUND_SetCurrentPosition(int channel,
                                                int offset)
Sets the current position of the sound in SAMPLES not bytes

Remarks FSOUND_ALL is supported. Passing this set the current position for the sound on ALL channels available. On XBOX, GameCube and Playstation 2 hardware voices using compressed data (ie XADPCM, VAG or GCADPCM), this value will not be sample accurate, but will be rounded to the nearest compression block size.

Parameters:
channel - The channel number/handle to have its offset or position set.
offset - The offset in SAMPLES from the start of the sound for the position to be set to.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_GetCurrentPosition

public static int FSOUND_GetCurrentPosition(int channel)
Returns the current playcursor position of the specified channel

Parameters:
channel - Channel number/handle to get the current position from.
Returns:
On success, the play cursor position in SAMPLES is returned for the specified channel. On failure, 0 is returned.

FSOUND_GetCurrentSample

public static FSoundSample FSOUND_GetCurrentSample(int channel)
Returns the current sample being played on the specified channel

Remarks Note that current sample does not return to NULL when a sound has ended.

Parameters:
channel - Channel number/handle to get the currently playing sample from.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_GetCurrentLevels

public static boolean FSOUND_GetCurrentLevels(int channel,
                                              java.nio.FloatBuffer l_r)
Returns a left and right VU/Level reading at the current position of the specified channel. Levels are are only supported for software channels.

Remarks By default this function is only point sampled and not latency adjusted (it will appear to trigger ahead of when you hear the sound). To fix this and get a 'perfect' set of levels in realtime, use FSOUND_INIT_ACCURATEVULEVELS with FSOUND_Init. ------------------- To get an overall VU reading for all sounds, add all VU values for each channel together, and then clip at 1.0. Another (harder) way is to write a dsp unit that reads from the mixbuffer being passed into it. Note: A true 'VU' should be smoothed, but in case people were after more accuracy than a smoothed value, it was decided to return the raw amplitude, and let the user smooth the result in their own way.

Parameters:
channel - Channel number/handle to retrieve left and right level from.
l_r - FloatBuffer to store left and right level, each between 0 and 1.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_GetFrequency

public static int FSOUND_GetFrequency(int channel)
Returns the frequency in HZ of the specified channel

Parameters:
channel - The number/handle to get the frequency from.
Returns:
On success, the frequency in HZ of the specified channel is returned. On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError.

FSOUND_GetLoopMode

public static int FSOUND_GetLoopMode(int channel)
Gets the loop mode for a particular channel

Remarks This works for all channel types, whereas setting it will not work.

Parameters:
channel - The channel number/handle to get the loop mode from.
Returns:
On success, the loop mode is returned. On failure, 0 is returned.

FSOUND_GetMixer

public static int FSOUND_GetMixer()
Returns the currently used mixer type

Returns:
FSOUND_GetMixer returns a defenition from FSOUND_MIXERTYPES. See FSOUND_MIXERTYPES for valid parameters and descriptions.

FSOUND_GetMute

public static boolean FSOUND_GetMute(int channel)
Returns if the channel specified is muted or not

Parameters:
channel - The channel number/handle to get the mute status from
Returns:
TRUE - The channel has mute turned ON. FALSE - The channel has mute turned OFF

FSOUND_GetNumSubChannels

public static int FSOUND_GetNumSubChannels(int channel)
This function returns the number of sub-channels stored in a multi-channel channel handle, which is only possible when playing back a multichannel .FSB file.

Remarks A multichannel sound, only possible with the .FSB format, can contain multiple subchannels. When a multichannel sound is played, multiple channels are allocated at the same time. For example, a 8 sounds/streams can be interleaved into a multichannel FSB. This function would return 8, as 8 real hardware/software voices are used during playback. FSOUND_GetSubChannel can be used to get access to the secondary channels.

Parameters:
channel - The value returned by FSOUND_Stream_Play, FSOUND_Stream_PlayEx, FSOUND_PlaySound, FSOUND_PlaySoundEx.
Returns:
On success, the number of subchannels is returned. On failure, 0 is returned.

FSOUND_GetPan

public static int FSOUND_GetPan(int channel)
Returns the linear pan position of the specified channel between 0 and 255

Parameters:
channel - The channel number/handle to get the pan from.
Returns:
On success, the following values are returned : 0 = full left to 128 = middle to 255 = full right, FSOUND_STEREOPAN On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError.

FSOUND_GetPaused

public static boolean FSOUND_GetPaused(int channel)
Gets current pause status of the channel

Remarks This function is useful for games that have a pause mode, and you dont want the sounds to continue playing, but you would like them to continue on from where they left off when you unpause.

Parameters:
channel - The channel number/handle to get the paused status from.
Returns:
TRUE - The channel is currently paused. FALSE - The channel is running.

FSOUND_GetPriority

public static int FSOUND_GetPriority(int channel)
Gets a sound channels priority. Priority is used to determine if soundeffects should replace other sound effects when the channel limit has been reached. See FSOUND_SetPriority for more information.

Parameters:
channel - The channel number/handle to get the priority from.
Returns:
On success, the priority of the channel is returned. Ranges between 0 and 255. On failure, 0 is returned. To quailfy if this is a real error, call FSOUND_GetError.

FSOUND_GetReserved

public static int FSOUND_GetReserved(int channel)
Gets a sound channels reserved status. priority is used to determine if soundeffects should muscle out other sound effects when the channel limit has been reached.

Parameters:
channel - The channel number/handle to get the reserved status from.
Returns:
TRUE Channel is reserved and cannot be selected. FALSE Channel is reserved and can be selected.

FSOUND_GetSubChannel

public static int FSOUND_GetSubChannel(int channel,
                                       int subchannel)
This function returns a channel handle from a subchannel within a multichannel FSB file, so that it can be maniuplated seperately, instead of controlling the whole multichannel array with the parent channel that the user retrieves from FSOUND_PlaySound etc.

Remarks A multichannel sound, only possible with the .FSB format, can contain multiple subchannels. When a multichannel sound is played, multiple channels are allocated at the same time. Normally you can just use the parent handle, and things like FSOUND_SetVolume will affect all subchannels at the same time. With this function, you can get access to the raw subchannels to allow manipulation of each voice seperately within the multichannel array. For example, a 8 sounds/streams can be interleaved into a multichannel FSB. If you specified a subchannel of 7, it would return a channel handle to the last channel in the multichannel array. A subchannel index of 0 is the parent channel, and the same as the voice passed in is a parameter. The number of subchannels within a multichannel voice can be determined with FSOUND_GetNumSubChannels.

Parameters:
channel - The value returned by FSOUND_Stream_Play, FSOUND_Stream_PlayEx, FSOUND_PlaySound, FSOUND_PlaySoundEx.
subchannel - Offset from the parent channel into the multichannel array.
Returns:
On success, a raw channel handle is returned. On failure, -1 is returned.

FSOUND_GetSurround

public static int FSOUND_GetSurround(int channel)
Returns the surround sound status of the specified channel.

Remarks Surround sound only works on software channels.

Parameters:
channel - The channel number/handle to get the surround sound status from
Returns:
On success, TRUE is returned meaning the channel has surround sound turned ON On failure, FALSE is returned meaning the channel has surround sound turned OFF

FSOUND_IsPlaying

public static boolean FSOUND_IsPlaying(int channel)
Returns if the channel is currently playing or not.

Parameters:
channel - Channel number/handle to get the playing status from.
Returns:
TRUE channel is currently active and playing. FALSE channel is currently idle.

FSOUND_3D_GetAttributes

public static boolean FSOUND_3D_GetAttributes(int channel,
                                              java.nio.FloatBuffer pos,
                                              java.nio.FloatBuffer vel)

Remarks A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this.

Parameters:
channel - Channel you want to get 3d information from
pos - Pointer to a position vector (xyz float triplet) of the emitter in world space, measured in distance units. This can be NULL to ignore it.
vel - Pointer to a velocity vector (xyz float triplet), of the emitter measured in distance units PER SECOND. This can be NULL to ignore it.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_3D_GetMinMaxDistance

public static boolean FSOUND_3D_GetMinMaxDistance(int channel,
                                                  java.nio.FloatBuffer minmax)
Returns the current min and max distance for a channel

Parameters:
channel - Channel number/handle to retrieve min and max distance from.
minmax - FloatBuffer to store min/max -distance.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_3D_Listener_GetAttributes

public static void FSOUND_3D_Listener_GetAttributes(java.nio.FloatBuffer pos,
                                                    java.nio.FloatBuffer vel,
                                                    java.nio.FloatBuffer fx,
                                                    java.nio.FloatBuffer fy,
                                                    java.nio.FloatBuffer fz,
                                                    java.nio.FloatBuffer tx,
                                                    java.nio.FloatBuffer ty,
                                                    java.nio.FloatBuffer tz)
This retreives the position, velocity and orientation of a 3d sound listener

Remarks FSOUND treats +X as right, +Y as up, and +Z as forwards. (left handed) To map to your own coordinate system, flip and exchange these values. For example if you wanted to use right handed coordinates, you would negate the Z value of your own direction vector. Orientation vectors are expected to be of UNIT length. This means the magnitude of the vector should be 1.0f. --------- A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. --------- Please remember to use units PER SECOND, NOT PER FRAME as this is a common mistake. Do not just use (pos - lastpos) from the last frame's data for velocity, as this is not correct. You need to time compensate it so it is given in units per SECOND. You could alter your pos - lastpos calculation to something like this. vel = (pos-lastpos) / (time taken since last frame in seconds). I.e. at 60fps the formula would look like this vel = (pos-lastpos) / 0.0166667.

Parameters:
pos - Pointer to a position vector (xyz float triplet), of the listener in world space, measured in distance units. This can be NULL to ignore it.
vel - Pointer to a velocity vector (xyz float triplet), of the listener measured in distance units PER SECOND. This can be NULL to ignore it.
fx - pointer to x component of a FORWARD unit length orientation vector This can be NULL to ignore it.
fy - pointer to y component of a FORWARD unit length orientation vector This can be NULL to ignore it.
fz - pointer to z component of a FORWARD unit length orientation vector This can be NULL to ignore it.
tx - pointer to x component of a TOP or upwards facing unit length orientation vector This can be NULL to ignore it.
ty - pointer to y component of a TOP or upwards facing unit length orientation vector This can be NULL to ignore it.
tz - pointer to z component of a TOP or upwards facing unit length orientation vector This can be NULL to ignore it.

FSOUND_3D_Listener_SetAttributes

public static void FSOUND_3D_Listener_SetAttributes(java.nio.FloatBuffer pos,
                                                    java.nio.FloatBuffer vel,
                                                    float fx,
                                                    float fy,
                                                    float fz,
                                                    float tx,
                                                    float ty,
                                                    float tz)
This updates the position, velocity and orientation of a 3d sound listener

Remarks FSOUND treats +X as right, +Y as up, and +Z as forwards. (left handed) To map to your own coordinate system, flip and exchange these values. For example if you wanted to use right handed coordinates, you would negate the Z value of your own direction vector. Orientation vectors are expected to be of UNIT length. This means the magnitude of the vector should be 1.0f. --------- A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. --------- Please remember to use units PER SECOND, NOT PER FRAME as this is a common mistake. Do not just use (pos - lastpos) from the last frame's data for velocity, as this is not correct. You need to time compensate it so it is given in units per SECOND. You could alter your pos - lastpos calculation to something like this. vel = (pos-lastpos) / (time taken since last frame in seconds). Ie at 60fps the formula would look like this vel = (pos-lastpos) / 0.0166667.

Parameters:
pos - Pointer to a position vector (xyz float triplet), of the listener in world space, measured in distance units. This can be NULL to ignore it.
vel - Pointer to a velocity vector (xyz float triplet), of the listener measured in distance units PER SECOND. This can be NULL to ignore it.
fx - x component of a FORWARD unit length orientation vector
fy - y component of a FORWARD unit length orientation vector
fz - z component of a FORWARD unit length orientation vector
tx - x component of a TOP or upwards facing unit length orientation vector
ty - y component of a TOP or upwards facing unit length orientation vector
tz - z component of a TOP or upwards facing unit length orientation vector

FSOUND_3D_Listener_SetCurrent

public static void FSOUND_3D_Listener_SetCurrent(int current,
                                                 int numlisteners)
Sets the current listener number and number of listeners, if the user wants to simulate multiple listeners at once. This is usually for the case in a game where there is a splitscreen and multiple players playing the game at once

Remarks Only affects FSOUND_3D_Listener_SetAttributes and FSOUND_3D_Listener_GetAttributes. Setting more than 1 listener will turn off doppler and cause all panning to be ignored and 3d sound will come from the center (mono). ------------- For WIN32 FSOUND_HW3D based sounds, channels must have their attributes set after this function is called, otherwise unexpected audible results may occur. For example you cannot update your channels with FSOUND_3D_SetAttributes, call FSOUND_3D_Listener_SetCurrent, and then call FSOUND_Update and expect all the voices to update correctly. The correct order is to call FSOUND_3D_Listener_SetCurrent first, then update all channels with FSOUND_3D_SetAttributes, then call FSOUND_Update. This is due to DirectSound not supporting multiple listeners, so FMOD has to do inverse transforms on the positions to simulate it with one listener, at the time FSOUND_3D_SetAttributes is called.

Parameters:
current - Current listener number. Listener commands following this function call will affect this listener number. (default: 0)
numlisteners - Number of listeners active. (default: 1)

FSOUND_3D_SetDistanceFactor

public static void FSOUND_3D_SetDistanceFactor(float scale)
Sets FMOD's 3d engine relative distance factor, compared to 1.0 meters. It equates to 'how many units per meter' does your engine have

Remarks By default this value is set at 1.0, or meters

Parameters:
scale - 1.0 = 1 meter units. If you are using feet then scale would equal 3.28.

FSOUND_3D_SetDopplerFactor

public static void FSOUND_3D_SetDopplerFactor(float scale)
Sets the doppler shift scale factor.

Remarks This is a general scaling factor for how much the pitch varies due to doppler shifting. Increasing the value above 1.0 exaggerates the effect, whereas lowering it reduces the effect. 0 removes the effect all together. FMOD's speed of sound at a DopplerFactor of 1.0 is 340 m/s.

Parameters:
scale - Doppler shift scale. Default value for FSOUND is 1.0f

FSOUND_3D_SetRolloffFactor

public static void FSOUND_3D_SetRolloffFactor(float rolloff)
Sets the global attenuation rolloff factor. Normally volume for a sample will scale at 1 / distance. This gives a logarithmic attenuation of volume as the source gets further away (or closer). Setting this value makes the sound drop off faster or slower. The higher the value, the faster volume will fall off. The lower the value, the slower it will fall off. For example a rolloff factor of 1 will simulate the real world, where as a value of 2 will make sounds attenuate 2 times quicker

Remarks --------- A 'distance unit' is specified by FSOUND_3D_SetDistanceFactor. By default this is set to meters which is a distance scale of 1.0. See FSOUND_3D_SetDistanceFactor for more on this. --------- The default rolloff factor is 1.0.

Parameters:
rolloff - The rolloff factor to set for this sample. Valid ranges are 0 to 10.

FSOUND_Stream_Open

public static FSoundStream FSOUND_Stream_Open(java.lang.String name,
                                              int mode,
                                              int offset,
                                              int length)
Opens an audio file/url/cd ready for streaming. This opens the file in preparation for playback in real-time, without needing to decode the whole file into memory first

Remarks WAV support supports windows codec compressed WAV files. -------------- FSOUND_MPEGACCURATE is to be used cautiously. To open a file with this mode turned on, it has to scan the whole MP3 first. This can take several seconds if the file is big, or the harddisk/cpu is slow. A way to speed up this process would be to load the compressed mp3 into memory first, and use the FSOUND_LOADMEMORY flag with this function. -------------- NOTE : Internet stream limitations - URLs must start with "http://". - The only supported formats for HTTP streams are MP3 (must have .mp3 extension) and OggVorbis (must have .ogg extension). -------------- FSB streaming is not supported if the format from FSBank is 'Retain original format'. On PC platforms, only PCM and ADPCM FSB files are allowed. -------------- Note, on PlayStation 2 you cannot use FSOUND_LOADMEMORY, you may use FSOUND_LOADMEMORYIOP though. -------------- When opening with the FSOUND_NONBLOCKING flag, this function always succeeds at the point of being called. It will always return a valid channel handle, even though the file might fail to open. To determine any error in non blocking mode use FSOUND_Stream_GetOpenState. -------------- NOTE: CDDA Streaming (Win32 only!) To open a CD for CDDA streaming, specify the drive letter of a CD drive e.g. FSOUND_Stream_Open("d:", 0, 0, 0); FSOUND_Stream_Open will create a stream with multiple substreams, one for each CD track. Use FSOUND_Stream_SetSubStream to select which CD track to play. A number of options can be passed to FSOUND_Stream_Open along with the drive letter. They are : ? e.g. FSOUND_Stream_Open("d:*?", 0, 0, 0); This option will cause a tag field called "CD_DEVICE_INFO" to be attached to the stream. This tag field contains information on the specified CD device. ! e.g. FSOUND_Stream_Open("d:*!", 0, 0, 0); This option will cause the stream to be opened in "quick open" mode. When a stream is opened in this mode, calls to FSOUND_Stream_SetSubStream will return immediately making it quick to select each substream in turn and get the length of each CD track. Note that a stream in quick open mode cannot be played! Use quick open mode to get track lengths and then re-open the stream without quick open mode to actually play it. j e.g. FSOUND_Stream_Open("d:*j", 0, 0, 0); This option turns jitter correction OFF. Options can be combined like so: FSOUND_Stream_Open("d:*?!j", 0, 0, 0); If a nonblocking CDDA stream fails to open, a tag field called "CD_ERROR" will be attached to the stream. This tag field contains a textual description of why the stream failed to open. NOTE: FMOD will always try to use native NTSCSI support to communicate with CD devices before trying to use ASPI. If FMOD is using ASPI then it can only access the first CD device it finds.

Parameters:
name - Name of the file to open, or pointer to data if FSOUND_LOADMEMORY is used.
mode - Simple description of how to play the file. For all formats except raw PCM, FSOUND_LOOP*, FSOUND_HW3D, FSOUND_HW2D, FSOUND_2D, FSOUND_LOADMEMORY, FSOUND_LOADRAW, FSOUND_MPEGACCURATE, FSOUND_NONBLOCKING flags are the only ones supported.
offset - Optional. 0 by default. If > 0, this value is used to specify an offset in a file, so fmod will seek before opening. length must also be specified if this value is used.
length - Optional. 0 by default. If > 0, this value is used to specify the length of a memory block when using FSOUND_LOADMEMORY, or it is the length of a file or file segment if the offset parameter is used. On PlayStation 2 this must be 16 byte aligned for memory loading.
Returns:
On success, a reference to an opened stream is returned. On failure, NULL is returned.

FSOUND_Stream_Open

public static FSoundStream FSOUND_Stream_Open(java.nio.ByteBuffer data,
                                              int mode)
Parameters:
data - data when FSOUND_LOADMEMORY is used.
mode - Simple description of how to play the file. For all formats except raw PCM, FSOUND_LOOP*, FSOUND_HW3D, FSOUND_HW2D, FSOUND_2D, FSOUND_LOADMEMORY, FSOUND_LOADRAW, FSOUND_MPEGACCURATE, FSOUND_NONBLOCKING flags are the only ones supported.
Returns:
On success, a reference to an opened stream is returned. On failure, NULL is returned.
See Also:
FSOUND_Stream_Open(String, int, int, int)

FSOUND_Stream_Play

public static int FSOUND_Stream_Play(int channel,
                                     FSoundStream stream)
Starts a pre-opened stream playing

Remarks When a stream starts to play, it inherits a special high priority (256). It cannot be rejected by other sound effect channels in the normal fashion as the user can never set a priority above 255 normally. -------------- If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. -------------- FSB streaming is not supported if the format from FSBank is 'Retain original format'. On PC platforms, only PCM and ADPCM FSB files are allowed. -------------- FSOUND_STEREOPAN is recommended for stereo streams if you call FSOUND_SetPan. This puts the left and right channel to full volume. Otherwise a normal pan will give half volume for left and right. See FSOUND_SetPan for more information on this. -------------- You can use normal channel based commands (such as FSOUND_SetVolume etc) on the return handle, as it is a channel handle.

Parameters:
channel - 0+ The channel index in the channel pool. This must not exceed the maximum number of channels allocated with FSOUND_Init FSOUND_FREE Chooses a free channel to play in. If all channels are used then it selects a channel with a sample playing that has a lower priority than the sample to be played.
stream - FSoundStream to be played.
Returns:
On success, the channel handle the stream is playing in is returned. On failure, -1 is returned.

FSOUND_Stream_Stop

public static boolean FSOUND_Stream_Stop(FSoundStream stream)
Stops a stream from playing

Remarks The stream is still prepared and sitting in memory ready to go. Use FSOUND_Stream_Close on the stream to completely remove it. If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready

Parameters:
stream - FSoundStream to be stopped
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_Close

public static boolean FSOUND_Stream_Close(FSoundStream stream)
Shuts down and releases an FSOUND stream

Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. The only exception to this rule is for internet streams - this function will successfully close an internet stream that has been opened with FSOUND_NONBLOCKING before that stream is ready.

Parameters:
stream - FSoundStream to be closed
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_GetNumSubStreams

public static int FSOUND_Stream_GetNumSubStreams(FSoundStream stream)
Returns the number of substreams inside a multi-stream FSB bank file

Parameters:
stream - FSoundStream to get substream count from
Returns:
On success, the number of FSB substreams is returned. On failure, 0 is returned.

FSOUND_Stream_SetSubStream

public static int FSOUND_Stream_SetSubStream(FSoundStream stream,
                                             int index)
Seeks a stream to the substream inside a multi-stream FSB bank file, specified by its index

Remarks A stream will stop if this function is called, as it needs to seek and flush the buffer. Indicies for this function are generated as user friendly constants when compiling the FSB bank, and are available in the relevant generated header file. -------------- If the stream has been opened with FSOUND_NONBLOCKING, this function will ALWAYS succeed, but puts the stream back into a non-ready state. You then have to poll after calling this to make sure the stream is ready. You can either do this by calling FSOUND_Stream_Play repeatedly/once a frame until it is succeeds, or FSOUND_Stream_GetOpenState.

Parameters:
stream - to have its position set
index - The index of the stream within the FSB file
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Stream_AddSyncPoint

public static FSoundSyncPoint FSOUND_Stream_AddSyncPoint(FSoundStream stream,
                                                         int pcmoffset,
                                                         java.lang.String name)
Adds a user synchronization callback point into a stream

Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready

Parameters:
stream - The stream to add a sync point to.
pcmoffset - Offset in SAMPLES (not bytes).
name - The name of the syncpoint, which will be passed into the sync callback when it is triggered.
Returns:
On success, a sync point handle is returned. On failure, NULL is returned.

FSOUND_Stream_Create

public static FSoundStream FSOUND_Stream_Create(FSoundStreamCallback callbackHandler,
                                                int lenbytes,
                                                int mode,
                                                int samplerate)
Creates a user definable stream file ready for playing. The stream is serviced through a callback

Remarks This method only supports SIGNED RAW streams to be written to the buffer supplied by the callback. They can be 8 or 16 bit, mono or stereo. 'lenbytes' may be rounded down to the nearest sample alignment in bytes. Ie if you specified 1001 bytes for a 16bit stereo sample stream, len would return 1000 in the callback. (250 samples * 4 bytes per sample) PlayStation 2 IMPORTANT! : if FSOUND_SendData is NOT called from the stream callback the IOP will hang because it is waiting for this command to be executed before it can unlock its buffer.

Parameters:
callbackHandler - FSoundStreamCallback to be called back
lenbytes - Size of the data in BYTES the callback will require to be written to the buffer.
mode - Description of the raw sample data being opened. see FSOUND_MODES for a description of these modes.
samplerate - Rate of playback. Be careful you dont set the sample rate too high so that the stream servicer (ie the harddisk) may not keep up.
Returns:
On success, a sync point handle is returned. On failure, NULL is returned.

FSOUND_Stream_CreateDSP

public static FSoundDSPUnit FSOUND_Stream_CreateDSP(FSoundStream stream,
                                                    FSoundDSPCallback callback,
                                                    int priority)
Allows the user to add a custom DSP unit to a stream

Remarks The priority for a stream DSP unit is not related to the priorities specified in fmod.h. The priorities are anything fom 0 onwards, and ALWAYS come after data is read/decoded for the stream *

Parameters:
stream - The stream to have a DSP attached to.
callback - A standard FSoundDSPCallback callback
priority - The priority, or position within the streams DSP chain to place the unit.
Returns:
On success, a handle to the FSoundDSPUnit is returned. All DSP functions are performable on this. On failure, null is returned

FSOUND_Stream_DeleteSyncPoint

public static boolean FSOUND_Stream_DeleteSyncPoint(FSoundSyncPoint point)
Removes a user synchronization callback point from a stream.

Parameters:
point - The sync point to remove
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Stream_FindTagField

public static boolean FSOUND_Stream_FindTagField(FSoundStream stream,
                                                 FSoundTagField field)
Find a tag field associated with an open stream by name and type

Parameters:
stream - The stream to get the tag field from.
field - FSoundTagField to find (using type, name)
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Stream_GetLength

public static int FSOUND_Stream_GetLength(FSoundStream stream)
Returns the size of the stream in BYTES

Remarks Position functions for streams work in bytes not samples. ----- This function is not supported for URL based streams over the internet.

Parameters:
stream - The stream to have its length returned
Returns:
On success, the size of the stream in BYTES is returned. On failure, 0 is returned.

FSOUND_Stream_GetLengthMs

public static int FSOUND_Stream_GetLengthMs(FSoundStream stream)
Returns the size of the stream in MILLISECONDS

Remarks FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy

Parameters:
stream - The stream to have its its total duration returned.
Returns:
On success, the size of the stream in MILLISECONDS is returned. On failure, 0 is returned.

FSOUND_Stream_GetMode

public static int FSOUND_Stream_GetMode(FSoundStream stream)
Retrieves the mode of the stream

Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.

Parameters:
stream - The stream to get the mode from
Returns:
mode of stream

nFSOUND_Stream_GetNumSyncPoints

public static int nFSOUND_Stream_GetNumSyncPoints(FSoundStream stream)
Returns the number of substreams inside a multi-stream FSB bank file

Parameters:
stream - stream to query
Returns:
On success, the number of FSB substreams is returned. On failure, 0 is returned

FSOUND_Stream_GetNumTagFields

public static boolean FSOUND_Stream_GetNumTagFields(FSoundStream stream,
                                                    java.nio.IntBuffer num)
Get the number of tag fields associated with the specified stream

Parameters:
stream - stream to query
num - IntBuffer that will receive the nubmer of tag fields associated with the specified stream.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_GetOpenState

public static int FSOUND_Stream_GetOpenState(FSoundStream stream)
If a stream is opened with FSOUND_NONBLOCKING, this function returns the state of the opening stream

Remarks A blocking stream will return NULL from FSOUND_Stream_Open so a return value of -3 is redundant in this case. A blocking stream will always return 0 if it is not NULL.

Parameters:
stream - to get the open state from.
Returns:
0 = stream is opened and ready. -1 = stream handle passed in is invalid. -2 = stream is still opening or performing a SetSubStream command. -3 = stream failed to open. (file not found, out of memory or other error). -4 = connecting to remote host (internet streams only) -5 = stream is buffering data (internet streams only)

FSOUND_Stream_GetPosition

public static int FSOUND_Stream_GetPosition(FSoundStream stream)
Returns the current FILE position of the stream of the stream in BYTES

Remarks Position functions for streams work in bytes not samples. Position information is also based on the current file position, not the actual playing position, so if the stream is only updated every 100ms, then the position will only be updated every 100ms. ----- This function is not supported for URL based streams over the internet or CDDA streams

Parameters:
stream - to have its position returned
Returns:
On success, the current stream's position in BYTES is returned. On failure, 0 is returned.

FSOUND_Stream_GetSample

public static FSoundSample FSOUND_Stream_GetSample(FSoundStream stream)
Returns the FSOUND_SAMPLE definition that the stream uses internally. You can use this to get a variety of information like the songs name, default speed and more.

Parameters:
stream - to have its internal sample pointer returned.
Returns:
On success, a handle to the FSOUND_SAMPLE definition is returned. On failure, 0 is returned

FSOUND_Stream_GetSyncPoint

public static FSoundSyncPoint FSOUND_Stream_GetSyncPoint(FSoundStream stream,
                                                         int index)
Obtains a sync point by index. This is useful when you havent created your own, ie it came from a wav file

Remarks Points are loaded in order of offset, so the index will represent the smallest point to the largest. *

Parameters:
stream - to have its position returned
index - The sync point offset into the stream
Returns:
On success, a handle to a sync point is returned. On failure, NULL is returned.

FSOUND_Stream_GetSyncPointInfo

public static java.lang.String FSOUND_Stream_GetSyncPointInfo(FSoundSyncPoint point,
                                                              java.nio.IntBuffer pcmoffset)
Retrieves the name and pcm offset in samples for a specified sync point

Remarks Convert samples to time by dividing the PCM value by the default samplerate. This would give you the value in seconds. Multiply by 1000 to get milliseconds.

Parameters:
point - handle to the sync point to retrieve information from
pcmoffset - An IntBuffer that will receive the sync point offset in pcm SAMPLES. A value of NULL will be ignored
Returns:
On success, the name of the syncpoint is returned as a string. On failure, NULL is returned.

FSOUND_Stream_GetTagField

public static boolean FSOUND_Stream_GetTagField(FSoundStream stream,
                                                int num,
                                                FSoundTagField field)
Get a tag field associated with an open stream

Remarks If this function returns successfully, "value" will contain a pointer to a piece of tag-field-specific data - do not assume it will always point to a null-terminated ASCII string.

Parameters:
stream - The stream to get the tag field from.
num - The number of the tag field to retrieve.
field - TagField to receive data
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_GetTime

public static int FSOUND_Stream_GetTime(FSoundStream stream)
Returns the current time offset in stream in milliseconds.

Remarks FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy

Parameters:
stream - to get the currently playing time offset
Returns:
On success, the current stream's position in milliseconds is returned. On failure, 0 is returned.

FSOUND_Stream_Net_GetBufferProperties

public static boolean FSOUND_Stream_Net_GetBufferProperties(java.nio.IntBuffer values)
Gets buffer size and thresholds that will be used when opening new internet streams

Remarks This function returns the values that will be used for subsequent internet stream opens. Internet streams that already exist may have different values.

Parameters:
values - IntBuffer to hold 3 int values: buffersize size in bytes of the streaming buffer. prebuffer_percent how much to prebuffer when a stream is first opened. Values are expressed as a percentage from 1 to 99. rebuffer_percent how much to rebuffer after a stream has suffered a buffer underrun. Values are expressed as a percentage from 1 to 99.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_Net_GetLastServerStatus

public static java.lang.String FSOUND_Stream_Net_GetLastServerStatus()
This function returns a String representing the last HTTP status line that was received when connecting to an internet stream

Remarks The result of this function should be used for informational purposes only. This function provides no facility to discover which internet stream the last HTTP status pertains to when there are multiple internet streams open.

Returns:
last HTTP status line that was received

FSOUND_Stream_Net_GetStatus

public static boolean FSOUND_Stream_Net_GetStatus(FSoundStream stream,
                                                  java.nio.IntBuffer values)
Get various status information for an internet stream

Parameters:
stream - to get status information on
values - IntBuffer to hold 4 int values: status variable that will receive a status value. See FSOUND_STREAM_NET_STATUS. bufferused variable that will receive the percentage of the read buffer that is currently in use. bitrate variable that will receive the current bitrate of the stream. flags variable that will receive a flags field describing protocol and format information. See FSOUND_STATUS_FLAGS.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_Net_SetBufferProperties

public static boolean FSOUND_Stream_Net_SetBufferProperties(int buffersize,
                                                            int prebuffer_percent,
                                                            int rebuffer_percent)
Sets buffer size and thresholds to use when opening new internet streams

Remarks Call this function before FSOUND_Stream_Open. This function has no effect on internet streams that are already open

Parameters:
buffersize - Size in bytes of the streaming buffer. Make it bigger to avoid buffer underruns. (Default = 64000)
prebuffer_percent - How much to prebuffer when a stream is first opened. Values are expressed as a percentage from 1 to 99. (Default = 95)
rebuffer_percent - How much to rebuffer after a stream has suffered a buffer underrun. Values are expressed as a percentage from 1 to 99. (Default = 95)
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_Net_SetMetadataCallback

public static boolean FSOUND_Stream_Net_SetMetadataCallback(FSoundStream stream,
                                                            FSoundMetaDataCallback callback)
Set a metadata callback for an internet stream

Remarks The supplied metadata callback function will be called each time the specified internet stream receives a chunk of metadata. Do not do any time-consuming processing in a metadata callback function or network subsystem performance may degrade. Do not attempt to modify or free any memory passed to a metadata callback function.

Parameters:
stream - to set the metadata callback for
callback - metadata callback to attach to this stream
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_Net_SetProxy

public static boolean FSOUND_Stream_Net_SetProxy(java.lang.String proxy)
Set a proxy server to use for all subsequent internet connections

Parameters:
proxy - The name of a proxy server in host:port format e.g. www.fmod.org:8888 (defaults to port 80 if no port is specified). Basic authentication is supported. To use it, this parameter must be in user:password@host:port format e.g. bob:sekrit123@www.fmod.org:8888 Set this parameter to NULL if no proxy is required
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_PlayEx

public static int FSOUND_Stream_PlayEx(int channel,
                                       FSoundStream stream,
                                       FSoundDSPUnit dspunit,
                                       boolean paused)
Extended featured version of FSOUND_Stream_Play. Added functionality includes the ability to start the stream paused. This allows attributes of a stream channel to be set freely before the stream actually starts playing, until FSOUND_SetPaused(FALSE) is used. Also added is the ability to associate the stream channel to a specified DSP unit. This allows the user to 'group' channels into seperate DSP units, which allows effects to be inserted between these 'groups', and allow various things like having one group affected by reverb (wet mix) and another group of channels unaffected (dry). This is useful to seperate things like music from being affected by DSP effects, while other sound effects are.

Remarks When a stream starts to play, it inherits a special high priority (256). It cannot be rejected by other sound effect channels in the normal fashion as the user can never set a priority above 255 normally. -------- FSOUND_STEREOPAN is recommended for stereo streams if you call FSOUND_SetPan. This puts the left and right channel to full volume. Otherwise a normal pan will give half volume for left and right. See FSOUND_SetPan for more information on this. -------- You can use normal channel based commands (such as FSOUND_SetVolume etc) on the return handle, as it is a channel handle.

Parameters:
channel - 0+ The absolute channel number in the channel pool. Remember software channels come first, followed by hardware channels. You cannot play a software sample on a hardware channel and vice versa. FSOUND_FREE Chooses a free channel to play in. If all channels are used then it selects a channel with a sample playing that has an EQUAL or LOWER priority than the sample to be played.
stream - already opened stream to be played
dspunit - dsp unit to attach the channel to
paused - Start the stream paused or not. Pausing the stream channel allows attributes to be set before it is unpaused
Returns:
On success, a channel handle the stream is playing in is returned. On failure, -1 is returned.

FSOUND_Stream_SetBufferSize

public static boolean FSOUND_Stream_SetBufferSize(int ms)
Sets the internal file buffersize for audio streaming of data for the NEXT stream opened with FSOUND_Stream_Open. Larger values will consume more memory (see remarks), whereas smaller values may be subject to large delays in disk access, especially from CDROM.

Remarks The default setting is 200ms. Under Windows CE it is default to 100ms. To calculate memory usage for a stream buffer, it is a simple matter of calculating sizebytes = streambuffersize * sample rate / 1000 * (bitdepth / 8) * numchannels * 2, where numchannels is 1 for mono, or 2 for stereo files. It is multiplied by 2 because FSOUND stream buffers are double buffers. Note this function does not affect user created streams, as the buffer size is specified in FSOUND_Stream_Create.

Parameters:
ms - Time in milliseconds between stream updates. FMOD tries to access the disk and decompress data every period specified. Values less than 50 result in an error
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetEndCallback

public static boolean FSOUND_Stream_SetEndCallback(FSoundStream stream,
                                                   FSoundStreamCallback callback)
Sets a callback function for when a stream has ended

Remarks Only calls back when a stream stops. (not when a looping stream reaches its end point) Note it uses a FSOUND_STREAMCALLBACK function callback. This is normally for user streams but for the sake of re-usability this prototype is used. 'buff' and 'length' are NULL and 0 in this case when the callback occurs. The return value can be TRUE or FALSE it is ignored. ----------- If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.

Parameters:
stream - to set the metadata callback for
callback - FSoundStreamCallback callback to attach to this stream
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetLoopCount

public static int FSOUND_Stream_SetLoopCount(FSoundStream stream,
                                             int count)
Sets the stream to loop the number of times specified by the user. If not called it loops forever

Remarks This specifies how many loops, not how many times to play the sound back. Therefore when you specify 0, you will hear the sound once, if you specify 1, you will hear the sound twice, and so on.

Parameters:
stream - already opened stream to be played
count - Number of times to loop. 0 would be similar to having FSOUND_LOOP_OFF set. >0 is infinity
Returns:
On success, a channel handle the stream is playing in is returned. On failure, -1 is returned.

FSOUND_Stream_SetLoopPoints

public static int FSOUND_Stream_SetLoopPoints(FSoundStream stream,
                                              int loopstart,
                                              int loopend)
Sets the loop points for a stream

Remarks For streams, setting looppoints is reasonably accurate but should not be assumed to be perfectly sample accurate in all cases. It depends on the compression format in some cases as seek positions need to be rounded to the nearest compression block offset. FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy. You cannot call this function wile the stream is playing, it has to be stopped

Parameters:
stream - already opened stream to be played
loopstart - The start of the loop, specified in PCM SAMPLES.
loopend - The end of the loop, specified in PCM SAMPLES.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetMode

public static int FSOUND_Stream_SetMode(FSoundStream stream,
                                        int mode)
Set a streams mode

Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. Only the following modes are accepted, others will be filtered out. FSOUND_LOOP_BIDI, FSOUND_LOOP_NORMAL, FSOUND_LOOP_OFF, FSOUND_2D. FSOUND_LOOP_BIDI is treated as FSOUND_LOOP_NORMAL. FSOUND_2D is accepted only if the sound is not hardware. On playstation 2, FSOUND_HW3D and FSOUND_HW2D modes are accepted

Parameters:
stream - to have the mode set
mode - The mode bits to set from FSOUND_MODES
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetPosition

public static int FSOUND_Stream_SetPosition(FSoundStream stream,
                                            int position)
Set a streams mode

Remarks Position functions for streams talk in bytes and NOT samples. The reason for not taking the header into account is people usually want to know the offset to seek to relative to the start of their data (ie as they see it in soundforge or whatever), not from offset 0 which is almost meaningless if you dont know the format. -------------- If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. *

Parameters:
stream - to have its position set
position - Offset in bytes from start of actual sound data (not including any header)
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetSubStreamSentence

public static int FSOUND_Stream_SetSubStreamSentence(FSoundStream stream,
                                                     java.nio.IntBuffer sentencelist)
This function allows the user to describe the playback order of a list of substreams. The substreams will be played back in order seamlessly.

Remarks This feature only works with FSB files that have multiple streams stored within it. To remove any sentence, simply call this function with NULL and 0. FMOD copies the list from the supplied pointer. Once the pointer is used, the caller can discard the original array. This function will fail if the stream is playing. The stream must be stopped for it to work. ------------ If the stream is opened with FSOUND_NONBLOCKING, and the stream is not ready (it is still opening), then this function will return FALSE. When it is ready, it will return TRUE, but after this call the stream is put back into a non-ready state, because it is asynchronously seeking again. You then have to poll after calling this to make sure the stream is ready. You can either do this by calling FSOUND_Stream_Play repeatedly/once a frame until it is succeeds, or FSOUND_Stream_GetOpenState. *

Parameters:
stream - stream to have its position returned.
sentencelist - IntBuffer describing a list of substream indicies to play back.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetSyncCallback

public static boolean FSOUND_Stream_SetSyncCallback(FSoundStream stream,
                                                    FSoundStreamCallback callback)
Sets a callback function for when a stream passes over a WAV tag/marker. These are markers that a sound editing program such as Sound Forge can drop into the actual wave data. FMOD will trigger callbacks with these markers when the stream plays, and pass in the string through the callback that the marker contains

Remarks Note it uses a FSOUND_STREAMCALLBACK function callback. This is normally for user streams but for the sake of re-usability this prototype is used. 'buff' is a null terminated string provided by the marker. 'len' is the offset in samples that the marker was set at. The return value can be TRUE or FALSE, it is ignored. ----------- Note you can save a WAV out using an MP3 wav codec (and then just rename the WAV to MP3 if you like) to get sync marker support for compressed MP3 files. FMOD will pick up on this and read the markers out. -------------- If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready.

Parameters:
stream - to set the SyncCallback callback for
callback - FSoundStreamCallback callback to attach to this stream
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Stream_SetTime

public static int FSOUND_Stream_SetTime(FSoundStream stream,
                                        int ms)
Sets the current stream's FILE position in MILLISECONDS

Remarks If the stream has been opened with FSOUND_NONBLOCKING, this function will not succeed until the stream is ready. FSOUND_MPEGACCURATE will need to be used with mp3 files that use VBR encoding for more accuracy.

Parameters:
stream - to have its position set
ms - Time in milliseconds to seek to.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_CD_OpenTray

public static boolean FSOUND_CD_OpenTray(char drive,
                                         boolean open)
Opens/Closes the CD tray

Parameters:
drive - The drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
open - If open is set to true, the CD tray will be opened. If open is set to false, the CD tray will be closed.
Returns:
On success, true is is returned. On failure, false is returned.

FSOUND_CD_GetNumTracks

public static int FSOUND_CD_GetNumTracks(char drive)
Returns the number of tracks on the currently inserted CD

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
Returns:
On success, the number of CD tracks on the currently inserted is returned. On failure, 0 is returned

FSOUND_CD_GetPaused

public static boolean FSOUND_CD_GetPaused(char drive)
Gets the pause status of the current CD audio track

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
Returns:
If the track is currently paused, TRUE is returned. if the track is currently not paused, FALSE is returned.

FSOUND_CD_GetTrack

public static int FSOUND_CD_GetTrack(char drive)
Returns the currently playing CD track number

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
Returns:
On success, the CD track number currently playing is returned. (starts from 1) On failure, 0 is returned

FSOUND_CD_GetTrackLength

public static int FSOUND_CD_GetTrackLength(char drive,
                                           int track)
Gets the track length of a CD

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
track - The CD track number to query the length of. (starts from 1)
Returns:
On success, the length of the current track in milliseconds is returned. On failure, 0 is returned.

FSOUND_CD_GetTrackTime

public static int FSOUND_CD_GetTrackTime(char drive)
Returns the current track time playing on a CD

Remarks This is easily one of the slowest functions in the FMOD API. Please use it sparingly. It seems like it shouldnt take long, but because of windows MCI API it does, and not just a little bit of time, it takes a LOT. It seems to poll the CD driver and cause a large delay upon completion of the command. Different algorithms were used to try and emulate this function such as simply using a timer, but this was very inaccurate, especially when pausing/unpausing a lot.

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
Returns:
On success, the position of the current playing track in milliseconds is returned. On failure, 0 is returned

FSOUND_CD_Play

public static boolean FSOUND_CD_Play(char drive,
                                     int track)
Plays a CD Audio track

Remarks See FSOUND_CD_SetPlayMode for information on how to control playback of a CD track. FSOUND's CD Playback system, is a non intrusive, non polling system. This may not mean much to a lot of people, but a polling player (take the windows default CD player) will consistantly poll the CD device to update its status, which causes other applications to jerk, or pause consistantly. This would be inexcusable in a game, to have the game halt or jerk every second to few seconds or so. FSOUND uses timing and prediction to loop tracks and update the status of the CD, and never touches the CD device during playback, for TRUE 0% cpu usage.

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
track - The CD track number to query the length of. (starts from 1)
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_CD_SetPaused

public static boolean FSOUND_CD_SetPaused(char drive,
                                          boolean paused)
Sets the pause status of the currently playing CD audio track

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
paused - TRUE to pause track, FALSE to unpause track
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_CD_SetPlayMode

public static void FSOUND_CD_SetPlayMode(char drive,
                                         int mode)
Sets the playback mode of the CD

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
mode - See FSOUND_CDPLAYMODES for a list of valid parameters to send to this function

FSOUND_CD_SetTrackTime

public static boolean FSOUND_CD_SetTrackTime(char drive,
                                             int ms)
Performs a seek within a track specified by milliseconds

Remarks This function will start the track if it is not playing

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
ms - Time to seek into the current track in milliseconds
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_CD_SetVolume

public static boolean FSOUND_CD_SetVolume(char drive,
                                          int volume)
Sets the volume of the playing CD audio

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
volume - An integer value from 0-255. 0 being the lowest volume, 255 being the highest (full).
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_CD_Stop

public static boolean FSOUND_CD_Stop(char drive)
Stops the currently playing CD audio track

Parameters:
drive - the drive ID to use. 0 is the default CD drive. Using D or E in single quotes would be D: or E: for example.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_DSP_ClearMixBuffer

public static void FSOUND_DSP_ClearMixBuffer()
Clears the mixbuffer, especially handy if you are doing a large file operation which halts the system. You might try and stop all the sounds, but if you do your file operation straight after this, it will not have a chance to flush the mixbuffer normally, so this function is called. It stops the effect of stuttering looping sound while your file operation happens.

Remarks The best way to do it is like this. Turn off the sfx and music DSP units, clear the mix buffer, then when the operation that halts the machine is done, just re-enable the sfx and music DSP units. Disabling these units stops the timer trying to get 1 or 2 more mixes in during the file operation, which will cause more stuttering. ie. FSOUND_DSP_SetActive(FSOUND_DSP_GetSFXUnit(), FALSE); FSOUND_DSP_SetActive(FSOUND_DSP_GetMusicUnit(), FALSE); FSOUND_DSP_ClearMixBuffer(); // // maching halting operation here // FSOUND_DSP_SetActive(FSOUND_DSP_GetSFXUnit(), TRUE); FSOUND_DSP_SetActive(FSOUND_DSP_GetMusicUnit(), TRUE);


FSOUND_DSP_Create

public static FSoundDSPUnit FSOUND_DSP_Create(FSoundDSPCallback callbackHandler,
                                              int priority)
Creates a DSP unit, and places it in the DSP chain position specified by the priority parameter. Read the remarks section carefully for issues regarding DSP units. DSP units are freed with FSOUND_DSP_Free

Remarks A dsp unit is NOT ACTIVE by default. You have to activate it with FSOUND_DSP_SetActive --------------------------------------------------------------------------------------- Priorities and default system units. --------------------------------------------------------------------------------------- A note on priorities. FSOUND processes DSP units in order of priority. A 0 priority unit gets processed first, a 1 priority unit gets processed next, and so on. FSOUND actually uses these DSP units to mix its sound effects and music! Yes, you have access to them (be careful!). It is possible to totally remove, replace or deactivate all of FSOUND's system units so that it does nothing at all! FSOUND has preinstalled default system units at the following priority locations: FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT (priority 0) - Clear Unit. This unit clears out the mixbuffer for the next units to mix into. You can disable this unit and replace it with something other than a clearer, such as a scaler, which fades down the mix buffer instead of clearing it, to produce a very rough echo effect. FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT (priority 100) - SFX Unit. This unit mixes sound effect channels into the mix buffer, which was previously cleared with the Clear Unit. FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT (priority 200) - Music Unit. This unit mixes all music channels into the mix buffer, which was previously mixed into with the SFX Unit. FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT (priority 1000) - Clip and Copy Unit. This unit takes the finally mixed buffer, and clips it to the output stream size (if it needs to), and then sends it off to the sound device. It is done last. If this is disabled you will hear no sound. --------------------------------------------------------------------------------------- Buffer Lengths. --------------------------------------------------------------------------------------- The 'length' value of the DSP callback is roughly 20ms worth of data. Use FSOUND_DSP_GetBufferLength to get the exact callback length. --------------------------------------------------------------------------------------- Buffer Widths --------------------------------------------------------------------------------------- Remember that FSOUND uses different buffer types depending on what type of mixer it is. You will have to compensate for this by writing different routines depending on the mixer type (ie mmx or non mmx), just like FSOUND does. Currently there are the 3 types of mixers and their buffer sizes. You can get the type of mixer being used by calling the FSOUND_GetMixer function. You may want to check on this inside your callback, or set up a function pointer system, whatever you think is suitable (it costs nothing to do a FSOUND_GetMixer every time). - FSOUND_MIXER_BLENDMODE : This buffer is a stereo, signed 32bit buffer (8 bytes per sample). The data is in integer format. Data written to this buffer is not clipped and passed to the output stream until the very end of the chain (the clip and copy unit). For this type of mixer, you dont have to worry about clipping becuase FSOUND does this for you. - FSOUND_MIXER_QUALITY_FPU / FSOUND_MIXER_QUALITY_FPU_VOLUMERAMP: This buffer is also a stereo, signed 32bit buffer (8 bytes per sample). This data is in floating point format. The same clip and copy rules apply here as for the above mixer. - Any MMX based mixer : This buffer is a stereo, signed 16bit buffer (4 bytes per sample). When writing to this buffer, you must make sure the result does not overflow this signed 16bit range. If you add data into to this buffer, make sure it is clipped to a signed 16bit range before writing it back. FSOUND only copies this data to the output stream, it does not clip it. --------------------------------------------------------------------------------------- Speed --------------------------------------------------------------------------------------- DSP Units are processed then and there, inside the mixing routine. Remember to make your process as FAST as possible, or the output device's play cursor will catch up to FSOUND's write cursor while your routine takes its time to complete, and make it start to break up. So basically, if it isnt fast, then FSOUND will not be able to send the data to the output device in time for the next mixer update, and the result will be corrupted sound. FSOUND_DSP_MixBuffers is available now, so if you need to mix some raw data into the output buffer quickly, you can use FSOUND's own optimized mixer directly to do it! Finally, you can see how your routine affects cpu usage, by using FSOUND_GetCPUUsage. The cpu usage returned by this function includes any time spent in DSP units as well. (this function times everything). If you are really bored, you can see how much FSOUND's system units take cpu-wise, by turning them on and off and seeing how they affect performance.

Parameters:
callbackHandler - This is a reference to your DSP Unit callback, of type FSOUND_DSPCALLBACK. The prototype for a callback is declared in the following fashion. Callbacks must return a pointer to the buffer you work on, so that the next dsp unit can work on it. See the definition of FSOUND_DSPCALLBACK for more.
priority - Order in the priority chain. Valid numbers are 0 to 1000, 0 being highest priority (first), with 1000 being lowest priority (last). Note that FSOUNDs soundeffects mixers and copy routines are considered part of this DSP unit chain which you can play with.
Returns:
On success, a new valid DSP unit is returned. On failure, NULL is returned.

FSOUND_DSP_Free

public static void FSOUND_DSP_Free(FSoundDSPUnit unit)
Frees and removes a DSP unit from the DSP chain

Parameters:
unit - DSP unit to be freed

FSOUND_DSP_SetActive

public static void FSOUND_DSP_SetActive(FSoundDSPUnit unit,
                                        boolean active)
Allows the user to toggle a DSP unit on or off

Remarks It is possible to toggle on and off FSOUNDs internal DSP units, though not recommended

Parameters:
unit - DSP unit to have its active flag changed
active - Flag to say whether DSP unit should be rendered active or inactive. valid values are TRUE or FALSE

FSOUND_DSP_GetActive

public static boolean FSOUND_DSP_GetActive(FSoundDSPUnit unit)
Returns if a DSP unit is active or not

Remarks It is possible to toggle on and off FSOUNDs internal DSP units, though not recommended

Parameters:
unit - DSP unit to have its active flag returned
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_DSP_GetBufferLength

public static int FSOUND_DSP_GetBufferLength()
Returns the buffer lenth passed by the DSP system to DSP unit callbacks, so you can allocate memory etc using this data

Remarks Remember this is samples not bytes. To convert to bytes you will have to multiply by 4 for mmx mixers, 8 for other mixers. (a stereo 16bit sample = 4 bytes, and a stereo 32bit sample (ie fpu) = 8 bytes)

Returns:
The size of the DSP unit buffer in SAMPLES (not bytes)

FSOUND_DSP_GetBufferLengthTotal

public static int FSOUND_DSP_GetBufferLengthTotal()
This is the total size in samples (not bytes) of the FSOUND mix buffer. This is affected by FSOUND_SetBufferSize.

Remarks Remember this is samples not bytes. To convert to bytes you will have to multiply by 4 for mmx mixers, 8 for other mixers. (a stereo 16bit sample = 4 bytes, and a stereo 32bit sample (ie fpu) = 8 bytes)

Returns:
The size of the FSOUND mixing buffer in SAMPLES (not bytes).

FSOUND_DSP_SetPriority

public static void FSOUND_DSP_SetPriority(FSoundDSPUnit unit,
                                          int priority)
Changes a DSP Unit's priority position in the DSP chain

Remarks DSP units with the same priority as a previous unit already in the chain will be placed AFTER all like priority units

Parameters:
unit - DSP unit to have its priority changed
priority - Order in the priority chain. Valid numbers are 0 to 1000, 0 being highest priority (first), with 1000 being lowest priority (last).

FSOUND_DSP_GetPriority

public static int FSOUND_DSP_GetPriority(FSoundDSPUnit unit)
Returns the priority status in the DSP chain, of a specified unit.

Remarks DSP units with the same priority as a previous unit already in the chain will be placed AFTER all like priority units

Parameters:
unit - DSP unit to get priority value from
Returns:
On success, the priority of the unit, from 0 to 1000. On failure, -1 is returned.

FSOUND_DSP_GetClearUnit

public static FSoundDSPUnit FSOUND_DSP_GetClearUnit()
Returns a reference to FSOUND's system DSP clear unit

Remarks The FSOUND clear DSP unit simply sets the mix buffer to 0, silencing it

Returns:
reference to the DSP unit

FSOUND_DSP_GetClipAndCopyUnit

public static FSoundDSPUnit FSOUND_DSP_GetClipAndCopyUnit()
Returns a reference to FSOUND's system Clip and Copy DSP unit

Remarks The FSOUND ClipAndCopy DSP unit clips the 32bit buffer down to fit the soundcard's 16bit stereo output, and sends it off to the hardware.

Returns:
reference to the DSP unit

FSOUND_DSP_GetMusicUnit

public static FSoundDSPUnit FSOUND_DSP_GetMusicUnit()
Returns a reference to FSOUND's system DSP Music mixer unit

Remarks The FSOUND Music DSP executes the FMUSIC engine and mixes the sounds spawned by the music player

Returns:
reference to the DSP unit

FSOUND_DSP_GetSFXUnit

public static FSoundDSPUnit FSOUND_DSP_GetSFXUnit()
Returns a reference to FSOUND's system DSP SFX mixer unit

Remarks The FSOUND SFX DSP unit mixes sound effects together spawned by the user

Returns:
reference to the DSP unit

FSOUND_DSP_GetFFTUnit

public static FSoundDSPUnit FSOUND_DSP_GetFFTUnit()
Returns a reference to FSOUND's system DSP FFT processing unit

Remarks The FSOUND FFT DSP executes the FFT engine to allow FSOUND_DSP_GetSpectrum to be used. The FFT unit is off by default, due to the cpu expense incurred in running. Turn it on to use FSOUND_DSP_GetSpectrum

Returns:
reference to the DSP unit

FSOUND_DSP_GetSpectrum

public static java.nio.FloatBuffer FSOUND_DSP_GetSpectrum()
Function to return a FloatBuffer to the current spectrum buffer. The buffer contains 512 floating point values that represent each frequency band's amplitude for the current FMOD SoundSystem mixing buffer. The range of frequencies covered by the spectrum is 1 to the nyquist frequency or half of the output rate. So if the output rate is 44100, then frequencies provided are up to 22050. (entry 511)

Remarks Note that hardware sounds, MIDI, files do not register on the spectrum graph as they are not run through FMODs DSP system. Note that to use this you have to turn on the FSOUND FFT DSP unit. This is achieved by calling FSOUND_DSP_GetFFTUnit, then using FSOUND_DSP_SetActive to turn it on.

Returns:
FloatBuffer containing 512 floats

FSOUND_DSP_MixBuffers

public static boolean FSOUND_DSP_MixBuffers(java.nio.ByteBuffer destbuffer,
                                            java.nio.ByteBuffer srcbuffer,
                                            int len,
                                            int freq,
                                            int vol,
                                            int pan,
                                            int mode)
Allows the user to mix their own data from one buffer to another, using FSOUNDs optimized mixer routines. This was mainly provided for DSP routines, though it can be used for anything.

Remarks 'destbuffer' should always the format of the mixing output buffer, as it will use the mixer currently running to do the mixing. For MMX it is 16bit stereo, so it is 4 bytes per output sample (word left, word right) For Standard Blend mode it is 32bit stereo, so it is 8 bytes per output sample (left dword, right dword) For FPU mixer it is 32bit float stereo, so it is 8 bytes per output sample (left float, right float) FSOUND_GetMixer can be used to determine which mixer is being used.

Parameters:
destbuffer - Pointer to a buffer to have the data mixed into.
srcbuffer - Pointer to the source buffer to be mixed in.
len - Amount to mix in SAMPLES.
freq - Speed to mix data to output buffer. Remember if you mix at a rate different than the output rate, the buffer lengths will have to be different to compensate. Ie if the output rate is 44100 and you supply a value of 88200 to FSOUND_DSP_MixBuffers, you will only need a destbuffer that is half the size of srcbuffer. If you supply a value of 22050 then you will need a destbuffer that is twice as big as srcbuffer. If they are both the same size then it will only mix half of the data.
vol - volume scalar value of mix. Valid values are 0 (silence) to 255 (full volume). See FSOUND_SetVolume for more information.
pan - pan value for data being mixed. Valid values are 0 (full left), 128 (middle), 255 (full right) and FSOUND_STEREOPAN. See FSOUND_SetPan for more information.
mode - Bit settings to describe the source buffer. Valid values are found in FSOUND_MODES, but only 8/16bit and stereo/mono flags are interpreted, other flags are ignored.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_Disable

public static boolean FSOUND_FX_Disable(int channel)
Disables effect processing for ALL effects on the specified channel

Remarks FSOUND_ALL is supported. Passing this will disable fx on ALL channels available. This command can only be issued while the channel is paused or stopped.

Parameters:
channel - Channel number/handle to disable all fx for
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_FX_Enable

public static int FSOUND_FX_Enable(int channel,
                                   int fxtype)
Enables effect processing for the specified channel. This command continues to add effects to a channel (up to 16) until FSOUND_FX_Disable is called.

Remarks FSOUND_ALL is supported. Passing this will enable fx on ALL channels available. This command can only be issued while the channel is paused. If an effect is not enabled, then it will not be affected by its corresponding FSOUND_FX_Set functions. This function must be played after a paused PlaySoundEx (ie FSOUND_PlaySoundEx(FSOUND_FREE, sound, NULL, TRUE)), and before the FSOUND_SetPaused(FALSE) so that the hardware can get the resource before it starts playing. A total of 16 FX per channel is allowed, any more will result in an error. FX are reset to 0 after a sound is stopped or played. (but as above, before the unpausing of a play-paused sound). Warning : This function is expensive to call as it has to set up fx buffers etc. It is best to call it once, reserve the channel then reuse the channel index when calling playsound without calling it again. Note : Channels with FX enabled sounds cannot have their frequency changed.

Parameters:
channel - Channel number/handle to disable all fx for
fxtype - A single fx enum value to enable certain effects.
Returns:
On success, an FX id is returned. On failure, -1 is returned

FSOUND_FX_SetChorus

public static boolean FSOUND_FX_SetChorus(int fxid,
                                          float WetDryMix,
                                          float Depth,
                                          float Feedback,
                                          float Frequency,
                                          int Waveform,
                                          float Delay,
                                          int Phase)
Sets the parameters for the chorus effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_CHORUS before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set chorus parameters for.
WetDryMix - Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0 through 100 (all wet).
Depth - Percentage by which the delay time is modulated by the low-frequency oscillator, in hundredths of a percentage point. Must be in the range from 0 through 100. The default value is 25.
Feedback - Percentage of output signal to feed back into the effects input, in the range from -99 to 99. The default value is 0.
Frequency - Frequency of the LFO, in the range from 0 to 10. The default value is 0.
Waveform - Waveform of the LFO. Defined values are 0 triangle. 1 sine. By default, the waveform is a sine.
Delay - Number of milliseconds the input is delayed before it is played back, in the range from 0 to 20. The default value is 0 ms.
Phase - Phase differential between left and right LFOs, in the range from 0 through 4. Possible values are defined as follows: 0 -180 degrees 1 - 90 degrees 2 0 degrees 3 90 degrees 4 180 degrees
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetCompressor

public static boolean FSOUND_FX_SetCompressor(int fxid,
                                              float Gain,
                                              float Attack,
                                              float Release,
                                              float Threshold,
                                              float Ratio,
                                              float Predelay)
Sets the parameters for the compressor effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_COMPRESSOR before using this function

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set compressor parameters for.
Gain - Output gain of signal after compression, in the range from -60 to 60. The default value is 0 dB.
Attack - Time before compression reaches its full value, in the range from 0.01 to 500. The default value is 0.01 ms.
Release - Speed at which compression is stopped after input drops below fThreshold, in the range from 50 to 3000. The default value is 50 ms.
Threshold - Point at which compression begins, in decibels, in the range from -60 to 0. The default value is -10 dB.
Ratio - Compression ratio, in the range from 1 to 100. The default value is 10, which means 10:1 compression.
Predelay - Time after lThreshold is reached before attack phase is started, in milliseconds, in the range from 0 to 4. The default value is 0 ms.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetDistortion

public static boolean FSOUND_FX_SetDistortion(int fxid,
                                              float Gain,
                                              float Edge,
                                              float PostEQCenterFrequency,
                                              float PostEQBandwidth,
                                              float PreLowpassCutoff)
Sets the parameters for the distortion effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_DISTORTION before using this function

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set distortion parameters for.
Gain - Amount of signal change after distortion, in the range from -60 through 0. The default value is 0 dB.
Edge - Percentage of distortion intensity, in the range in the range from 0 through 100. The default value is 50 percent.
PostEQCenterFrequency - Center frequency of harmonic content addition, in the range from 100 through 8000. The default value is 4000 Hz.
PostEQBandwidth - Width of frequency band that determines range of harmonic content addition, in the range from 100 through 8000. The default value is 4000 Hz.
PreLowpassCutoff - Filter cutoff for high-frequency harmonics attenuation, in the range from 100 through 8000. The default value is 4000 Hz.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetEcho

public static boolean FSOUND_FX_SetEcho(int fxid,
                                        float WetDryMix,
                                        float Feedback,
                                        float LeftDelay,
                                        float RightDelay,
                                        int PanDelay)
Sets the parameters for the echo effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_ECHO before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set echo parameters for.
WetDryMix - Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0 through 100 (all wet).
Feedback - Percentage of output fed back into input, in the range from 0 through 100. The default value is 0.
LeftDelay - Delay for left channel, in milliseconds, in the range from 1 through 2000. The default value is 333 ms.
RightDelay - Delay for right channel, in milliseconds, in the range from 1 through 2000. The default value is 333 ms.
PanDelay - Value that specifies whether to swap left and right delays with each successive echo. The default value is FALSE, meaning no swap. Possible values are defined as TRUE or FALSE.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetFlanger

public static boolean FSOUND_FX_SetFlanger(int fxid,
                                           float WetDryMix,
                                           float Depth,
                                           float Feedback,
                                           float Frequency,
                                           int Waveform,
                                           float Delay,
                                           int Phase)
Sets the parameters for the echo effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_FLANGER before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set flanger parameters for.
WetDryMix - Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0 through 100 (all wet).
Depth - Percentage by which the delay time is modulated by the low-frequency oscillator (LFO), in hundredths of a percentage point. Must be in the range from 0 through 100. The default value is 25.
Feedback - Percentage of output signal to feed back into the effects input, in the range from -99 to 99. The default value is 0.
Frequency - Frequency of the LFO, in the range from 0 to 10. The default value is 0.
Waveform - Waveform of the LFO. By default, the waveform is a sine. Possible values are defined as follows: 0 - Triangle. 1 - Sine.
Delay - Number of milliseconds the input is delayed before it is played back, in the range from 0 to 4. The default value is 0 ms.
Phase - Phase differential between left and right LFOs, in the range from 0 through 4. Possible values are defined as follows: 0 -180 degrees 1 - 90 degrees 2 0 degrees 3 90 degrees 4 180 degrees
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetGargle

public static boolean FSOUND_FX_SetGargle(int fxid,
                                          int RateHz,
                                          int WaveShape)
Sets the parameters for the echo effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_GARGLE before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set gargle parameters for.
RateHz - Rate of modulation, in Hertz. Must be in the range from 1 through 1000.
WaveShape - Shape of the modulation wave. The following values are defined. 0 - Triangular wave. 1 - Square wave.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetI3DL2Reverb

public static boolean FSOUND_FX_SetI3DL2Reverb(int fxid,
                                               int Room,
                                               int RoomHF,
                                               float RoomRolloffFactor,
                                               float DecayTime,
                                               float DecayHFRatio,
                                               int Reflections,
                                               float ReflectionsDelay,
                                               int Reverb,
                                               float ReverbDelay,
                                               float Diffusion,
                                               float Density,
                                               float HFReference)
Sets the parameters for the I3DL2 Reverb effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_I3DL2REVERB before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set I3DL2 Reverb parameters for.
Room - Attenuation of the room effect, in millibels (mB), in the range from -10000 to 0. The default value is -1000 mB.
RoomHF - Attenuation of the room high-frequency effect, in mB, in the range from -10000 to 0. The default value is 0 mB.
RoomRolloffFactor - Rolloff factor for the reflected signals, in the range from 0 to 10. The default value is 0.0. The rolloff factor for the direct path is controlled by the listener.
DecayTime - Decay time, in seconds, in the range from .1 to 20. The default value is 1.49 seconds.
DecayHFRatio - Ratio of the decay time at high frequencies to the decay time at low frequencies, in the range from 0.1 to 2. The default value is 0.83.
Reflections - Attenuation of early reflections relative to lRoom, in mB, in the range from -10000 to 1000. The default value is -2602 mB.
ReflectionsDelay - Delay time of the first reflection relative to the direct path, in seconds, in the range from 0 to 0.3. The default value is 0.007 seconds.
Reverb - Attenuation of late reverberation relative to lRoom, in mB, in the range from -10000 to 2000. The default value is 200 mB.
ReverbDelay - Time limit between the early reflections and the late reverberation relative to the time of the first reflection, in seconds, in the range from 0 to 0.1. The default value is 0.011 seconds.
Diffusion - Echo density in the late reverberation decay, in percent, in the range from 0 to 100. The default value is 100.0 percent.
Density - Modal density in the late reverberation decay, in percent, in the range from 0 to 100. The default value is 100.0 percent.
HFReference - Reference high frequency, in hertz, in the range from 20 to 20000. The default value is 5000.0 Hz.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetParamEQ

public static boolean FSOUND_FX_SetParamEQ(int fxid,
                                           float Center,
                                           float Bandwidth,
                                           float Gain)
Sets the parameters for the I3DL2 Reverb effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_FX_PARAMEQ before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set ParamEQ parameters for.
Center - Center frequency, in hertz, in the range from 80 to 16000. This value cannot exceed one-third of the frequency of the buffer. Default is 8000.
Bandwidth - Bandwidth, in semitones, in the range from 1 to 36. Default is 12.
Gain - Gain, in the range from -15 to 15. Default is 0.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_FX_SetWavesReverb

public static boolean FSOUND_FX_SetWavesReverb(int fxid,
                                               float InGain,
                                               float ReverbMix,
                                               float ReverbTime,
                                               float HighFreqRTRatio)
Sets the parameters for the Waves Reverb effect on a particular channel

Remarks Make sure you have enabled this effect with FSOUND_FX_Enable and FSOUND_WAVES_REVERB before using this function.

Parameters:
fxid - fx handle generated by FSOUND_FX_Enable, to set ParamEQ parameters for.
InGain - Input gain of signal, in decibels (dB), in the range from -96 through 0. The default value is 0 dB.
ReverbMix - Reverb mix, in dB, in the range from -96 through 0. The default value is 0 dB.
ReverbTime - Reverb time, in milliseconds, in the range from .001 through 3000. The default value is 1000.
HighFreqRTRatio - In the range from .001 through .999. The default value is 0.001.
Returns:
On success, TRUE is returned. On failure, FALSE is returned.

FSOUND_Record_GetDriver

public static int FSOUND_Record_GetDriver()
Returns the currently selected recording driver number. Drivers are enumerated when selecting a driver with FSOUND_Record_SetDriver or other driver related functions such as FSOUND_Record_GetNumDrivers or FSOUND_Record_GetDriverName

Returns:
Currently selected driver id

FSOUND_Record_GetDriverName

public static java.lang.String FSOUND_Record_GetDriverName(int id)
Returns the name of the selected recording driver. Drivers are enumerated when selecting a driver with FSOUND_Record_SetDriver or other driver related functions such as FSOUND_Record_GetNumDrivers or FSOUND_Record_GetDriver

Parameters:
id - Enumerated driver ID. This must be in a valid range delimited by FSOUND_Record_GetNumDrivers,
Returns:
On success, a string containing the name of the specified device is returned. The number of drivers enumerated can be found with FSOUND_Record_GetNumDrivers. On failure, NULL is returned

FSOUND_Record_GetNumDrivers

public static int FSOUND_Record_GetNumDrivers()
Returns the number of sound cards or devices enumerated for the current input type. (Direct Sound, WaveOut etc.)

Returns:
Total number of enumerated sound devices

FSOUND_Record_GetPosition

public static int FSOUND_Record_GetPosition()
Gets the position in the sample buffer that has been recorded to

Remarks Note. This is not the 'recording cursor', but rather the latest point that the input has been copied to your sample

Returns:
On success, the offset in SAMPLES, for the record buffer that the input device has just written up to is returned. On failure (recording device hasnt been started), -1 is returned.

FSOUND_Record_SetDriver

public static boolean FSOUND_Record_SetDriver(int driverno)
Returns the name of the selected recording driver. Drivers are enumerated when selecting a driver with FSOUND_Record_SetDriver or other driver related functions such as FSOUND_Record_GetNumDrivers or FSOUND_Record_GetDriver

Parameters:
driverno - Recording driver number to select. >=0 will select the DEFAULT recording sound driver. <0 Selects other valid drivers that can be listed with FSOUND_Record_GetDriverName.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Record_StartSample

public static boolean FSOUND_Record_StartSample(FSoundSample sample,
                                                boolean loop)
Starts recording into a predefined sample using the sample's default playback rate as the recording rate

Remarks If you want to play back the sample at the same time is is recording, you will have to play the sound and try and keep it just behind the recording cursor. Under FSOUND_OUTPUT_OSS mode, it is single duplex, so playback will stop when recording is in progress! Try FSOUND_OUTPUT_ALSA for full duplex as they have better drivers in this respect. ------------- The recording/playback rates are slightly innacurate and are not identical (ie 44100.0 for playback, 44100.1 for recording), so one could possibly be faster or slower than the other. In this case the recording and the playback cursor could overlap, and the output will sound corrupted. To counter this you might adjust the playback frequency of the channel you are playing the record sample on while it plays, using FSOUND_GetCurrentPosition and FSOUND_Record_GetPosition as calibration points. In the recording sample there is an example of trying to play back sound as it records, and the mechanism to try and keep the 2 cursors a safe distance from each other is employed.

Parameters:
sample - The sample to record into.
loop - TRUE or FALSE flag whether the recorder should keep recording once it has hit the end, and start from the start again, therefore creating a continuous recording session into that sample buffer. Looping the recording buffer is good for realtime processing of recorded information, as you can record and playback the sample at the same time.
Returns:
TRUE or FALSE flag whether the recorder should keep recording once it has hit the end, and start from the start again, therefore creating a continuous recording session into that sample buffer. Looping the recording buffer is good for realtime processing of recorded information, as you can record and playback the sample at the same time

FSOUND_Record_Stop

public static boolean FSOUND_Record_Stop()
Halts recording to the specified sample

Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Reverb_SetProperties

public static boolean FSOUND_Reverb_SetProperties(FSoundReverbProperties reverb)
Sets hardware reverb parameters for advanced tuning. The best way to modify these is to set everything to use pre-defined presets given in the header, and then start modifying values

Remarks You must be using FSOUND_OUTPUT_DSOUND as the output mode for this to work. In dsound, the reverb will only work if you have an EAX compatible soundcard such as the SBLive, and your sample/stream was created with the FSOUND_HW3D flag. For GameCube, use FSOUND_AUXFX_xxx api

Parameters:
reverb - reference to a FSoundReverbProperties.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Reverb_GetProperties

public static boolean FSOUND_Reverb_GetProperties(FSoundReverbProperties reverb)
Returns the current hardware reverb environment. The best way to modify these is to set everything to use pre-defined presets given in the header, and then start modifying values

Remarks These values are only relevant if you are in DSOUND mode with an EAX3 compatible soundcard, or XBOX and PS2

Parameters:
reverb - reference to a FSoundReverbProperties.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Reverb_SetChannelProperties

public static boolean FSOUND_Reverb_SetChannelProperties(int channel,
                                                         FSoundReverbChannelProperties reverb)
Sets the channel specific reverb properties for hardware, including wet/dry mix (room size), and things like obstruction and occlusion properties

Remarks FSOUND_ALL is supported here. Passing this will set ALL channels to specified reverb properties. If FSOUND_ALL is used the last channel success flag will be returned. This return value not useful in most circumstances. ----------------- Under Win32, you must be using FSOUND_OUTPUT_DSOUND as the output mode for this to work. In DSound, the reverb will only work if you have an EAX compatible soundcard such as the SBLive, and your sample/stream was created with the FSOUND_HW3D flag. ----------------- On PlayStation2, the 'Room' parameter is the only parameter supported. The hardware only allows 'on' or 'off', so the reverb will be off when 'Room' is -10000 and on for every other value. ----------------- On XBox, it is possible to apply reverb to 2d voices using this function. By default reverb is turned off for 2d voices. If this 2d voice was being positioned in a 5.1 array with the xbox only function FSOUND_SetLevels, then calling this function will disable that capability in favour of enabling reverb for the 2d voice. It is a limitation of the xbox hardware that only one of the other of these features can be executed at one time.

Parameters:
channel - The channel to have its reverb properties changed. FSOUND_ALL can also be used (see remarks)
reverb - reference to a FSoundReverbChannelProperties.
Returns:
On success, TRUE is returned. On failure, FALSE is returned

FSOUND_Reverb_GetChannelProperties

public static boolean FSOUND_Reverb_GetChannelProperties(int channel,
                                                         FSoundReverbChannelProperties reverb)
This function gets the current reverb properties for this channel

Parameters:
channel - The channel to have its reverb mix returned
reverb - reference to a FSoundReverbChannelProperties.
Returns:
On success, TRUE is returned. On failure, FALSE is returned


Copyright © 2002-2006 lwjgl.org. All Rights Reserved.