Post by DJLinux on Dec 1, 2007 5:37:22 GMT -5
Download: FreeSoundPlugin.zip
extract the archieve to your HD with main folder "\FreeSoundPlugin
navigate with your file explorer to the folder \FreeSoundPlugin
and open the basic4gl programs *.gb
short highlights:
fast mixer pipeline (optimzed in assembler used MMX and SSE if aviable)
up to 512 sounds in parallel
10 Band EQ's (for master channel)
you can change all params while sound are playing in fine steps
nLoops 1 to n (-1 endless)
Speed# -2.0 to +2.0 (-=backward +=forward)
Volume# 0.0 to 2.0 (1.0 = normal)
Pan# -1.0 to +1.0 (-1.0=left 0.0=center 1.0 = right)
one realtime mp3 stream decoder for very large background music
curently supported sound formats are *.wav, *.mp3 and *.ogg
Joshy
FreeSound Plugin Commands
Section Plugin
fsSetPlugPath("path")
Set plugin path only if not the same as exepath
fsInit()
Select default playbackdevice with 44.1 KHz Stereo 3 Buffers Frames=2048
fsInitSetup(nRate,nChannels,nBuffers,nFrames,nIndex)
Setup your own playbackdevice
nRate=6,000Hz. - 192,000Hz.
nChannels 1=Mono 2=Stereo(default)
nBuffers =3 to 64 (3=default)
nFrames=256-32768 (2048=default)
nIndex = DeviceIndex 0=first 1=second 2=third ...
After fsInit() or fsInitSetup(params,...)
nSamplerate=fsGetRate()
nChannels=fsGetChannels()
nBits=fsGetBits()
nBuffers=fsGetBuffers()
nFrames=fsGetFrames()
While FreeSoundPlugin are running
nBytes=fsGetPlayedBytes()
Get number of played bytes.
nSamples=fsGetPlayedSamples()
Get number of played samples.
Seconds#=fsGetPlayTime()
Get playtime in number seconds .
Section hWave Object
fsLoadWAVFile("file.wav",hWave)
Load a wave file in the pool of waves hWave return it's handle
fsLoadMP3File("file.mp3",hWave[,"tmpfile"])
Load a mp3 file in the pool of waves hWave return it's handle
fsLoadOGGFile("file.ogg",hWave[,"tmpfile"])
Load a oog file in the pool of waves hWave return it's handle
fsPlayWave(hWave)
Play an hWave object from pool of waves.
fsPlayWaveLooped(hWave,nLoops)
Play an hWave object looped from pool of waves.
fsPlayWaveSetup(hWave,nLoops,Speed#,Volume#,Pan#)
Play an hWave with params
nLoops 1-n (-1=endless)
Speed# -2.0 to +2.0 (-=backward +=forward)
Volume# 0.0 to 2.0
Pan# -1.0 to +1.0 (-1.0=left 0.0=center #1.0=right)
(an hWave object used these params for the whole playback time
if you will change any params while playing use an hSound object)
fsDestroyWave(hWave)
Remove an hWave object from pool of waves.
Section hSound Object
fsCreateSound(hWave,hSound)
Create an hSound object from hWave object
The primary diffrenc between an hWave and an hSound object
is the fact you can change all params while an hSound object are played.
fsDetroySound(hSound)
Remove an hSound object from pool of Sounds
fsPlaySound(hSound)
Playback an hSound object
fsPlaySoundLooped(hSound,nLoops)
Playback an hSound object looped.
get / set hSound params while played or not
fsSetSoundSpeed(hSound,Speed#)
fsGetSoundSpeed(hSound,Speed#)
fsSetSoundVolume(hSound,Volume#)
fsGetSoundVolume(hSound,Volume#)
fsSetSoundPan(hSound,Pan#)
fsGetSoundPan(hSound,Pan#)
fsSetSoundLoops(hSound,nLoops)
fsGetSoundLoops(hSound,nLoops)
fsSetSoundMuted(hSound,Muted)
fsGetSoundMuted(hSound,Muted)
Playbackpointer are moved but no sound will be produced.
fsSetSoundPaused(hSound,Paused)
fsGetSoundPaused(hSound,Paused)
Playbackpointer are still standing and no sound will be produced.
nSounds=fsGetPlayingSounds()
Count all curent playing hSound and hWave objects.
Section realtime MP3 decoder
For large mp3 files (menu or backgroundmusic) it exist one
realtime mp3 decoder stream. Of course you can load
large mp3 files with fsLoadMP3File("file.mp3",hWave) too
but this needs a short time to decode the whole file in memory.
A stream object will begin playing without any delay.
fsCreateMp3Stream("file.mp3")
fsPlayMP3Stream()
Begin realtime decoding and playing.
fsEndMP3Stream()
Stop an realtime decoder stream.
Set stream params
fsSetStreamVolume(Volume#)
fsGetStreamVolume(Volume#)
fsSetStreamPan(Pan#)
fsGetStreamPan(Pan#)
nStreams=fsGetPlayingStreams()
(curently returns 0 or 1)
Section Master Channel
Set master params
fsSetMasterVolume(Volume#)
fsGetMasterVolume(Volume#)
Set one of 10 band EQ's ( 0 to 9)
fsSetMasterFilter(nFilter,CenterFrq#,DB#,Octave#)
nFilter =0 to 9
CenterFreq# = 50HZ-22050Hz
DB# -3 = 0.5Volume 0=1.0volume 3=1.5Volume 6=2,0Volume
Octave= 0.1-2.0 Octaves
En-/disable one of the 10Band EQ's
fsEnableMasterFilter(nFilter)
fsDisableMasterFilter(nFilter)
fsEnableGetSamples()
fsDisableGetSamples()
Array=fsGetSamples(MAXSAMPLES,NewSamplesInArray)
or
NewSamplesInArray=fsGetSamples2(Array)
Tool
Tempfile$ = fsGetTempFile()
Create a system wide unique temporary filename
extract the archieve to your HD with main folder "\FreeSoundPlugin
navigate with your file explorer to the folder \FreeSoundPlugin
and open the basic4gl programs *.gb
short highlights:
fast mixer pipeline (optimzed in assembler used MMX and SSE if aviable)
up to 512 sounds in parallel
10 Band EQ's (for master channel)
you can change all params while sound are playing in fine steps
nLoops 1 to n (-1 endless)
Speed# -2.0 to +2.0 (-=backward +=forward)
Volume# 0.0 to 2.0 (1.0 = normal)
Pan# -1.0 to +1.0 (-1.0=left 0.0=center 1.0 = right)
one realtime mp3 stream decoder for very large background music
curently supported sound formats are *.wav, *.mp3 and *.ogg
Joshy
FreeSound Plugin Commands
Section Plugin
fsSetPlugPath("path")
Set plugin path only if not the same as exepath
fsInit()
Select default playbackdevice with 44.1 KHz Stereo 3 Buffers Frames=2048
fsInitSetup(nRate,nChannels,nBuffers,nFrames,nIndex)
Setup your own playbackdevice
nRate=6,000Hz. - 192,000Hz.
nChannels 1=Mono 2=Stereo(default)
nBuffers =3 to 64 (3=default)
nFrames=256-32768 (2048=default)
nIndex = DeviceIndex 0=first 1=second 2=third ...
After fsInit() or fsInitSetup(params,...)
nSamplerate=fsGetRate()
nChannels=fsGetChannels()
nBits=fsGetBits()
nBuffers=fsGetBuffers()
nFrames=fsGetFrames()
While FreeSoundPlugin are running
nBytes=fsGetPlayedBytes()
Get number of played bytes.
nSamples=fsGetPlayedSamples()
Get number of played samples.
Seconds#=fsGetPlayTime()
Get playtime in number seconds .
Section hWave Object
fsLoadWAVFile("file.wav",hWave)
Load a wave file in the pool of waves hWave return it's handle
fsLoadMP3File("file.mp3",hWave[,"tmpfile"])
Load a mp3 file in the pool of waves hWave return it's handle
fsLoadOGGFile("file.ogg",hWave[,"tmpfile"])
Load a oog file in the pool of waves hWave return it's handle
fsPlayWave(hWave)
Play an hWave object from pool of waves.
fsPlayWaveLooped(hWave,nLoops)
Play an hWave object looped from pool of waves.
fsPlayWaveSetup(hWave,nLoops,Speed#,Volume#,Pan#)
Play an hWave with params
nLoops 1-n (-1=endless)
Speed# -2.0 to +2.0 (-=backward +=forward)
Volume# 0.0 to 2.0
Pan# -1.0 to +1.0 (-1.0=left 0.0=center #1.0=right)
(an hWave object used these params for the whole playback time
if you will change any params while playing use an hSound object)
fsDestroyWave(hWave)
Remove an hWave object from pool of waves.
Section hSound Object
fsCreateSound(hWave,hSound)
Create an hSound object from hWave object
The primary diffrenc between an hWave and an hSound object
is the fact you can change all params while an hSound object are played.
fsDetroySound(hSound)
Remove an hSound object from pool of Sounds
fsPlaySound(hSound)
Playback an hSound object
fsPlaySoundLooped(hSound,nLoops)
Playback an hSound object looped.
get / set hSound params while played or not
fsSetSoundSpeed(hSound,Speed#)
fsGetSoundSpeed(hSound,Speed#)
fsSetSoundVolume(hSound,Volume#)
fsGetSoundVolume(hSound,Volume#)
fsSetSoundPan(hSound,Pan#)
fsGetSoundPan(hSound,Pan#)
fsSetSoundLoops(hSound,nLoops)
fsGetSoundLoops(hSound,nLoops)
fsSetSoundMuted(hSound,Muted)
fsGetSoundMuted(hSound,Muted)
Playbackpointer are moved but no sound will be produced.
fsSetSoundPaused(hSound,Paused)
fsGetSoundPaused(hSound,Paused)
Playbackpointer are still standing and no sound will be produced.
nSounds=fsGetPlayingSounds()
Count all curent playing hSound and hWave objects.
Section realtime MP3 decoder
For large mp3 files (menu or backgroundmusic) it exist one
realtime mp3 decoder stream. Of course you can load
large mp3 files with fsLoadMP3File("file.mp3",hWave) too
but this needs a short time to decode the whole file in memory.
A stream object will begin playing without any delay.
fsCreateMp3Stream("file.mp3")
fsPlayMP3Stream()
Begin realtime decoding and playing.
fsEndMP3Stream()
Stop an realtime decoder stream.
Set stream params
fsSetStreamVolume(Volume#)
fsGetStreamVolume(Volume#)
fsSetStreamPan(Pan#)
fsGetStreamPan(Pan#)
nStreams=fsGetPlayingStreams()
(curently returns 0 or 1)
Section Master Channel
Set master params
fsSetMasterVolume(Volume#)
fsGetMasterVolume(Volume#)
Set one of 10 band EQ's ( 0 to 9)
fsSetMasterFilter(nFilter,CenterFrq#,DB#,Octave#)
nFilter =0 to 9
CenterFreq# = 50HZ-22050Hz
DB# -3 = 0.5Volume 0=1.0volume 3=1.5Volume 6=2,0Volume
Octave= 0.1-2.0 Octaves
En-/disable one of the 10Band EQ's
fsEnableMasterFilter(nFilter)
fsDisableMasterFilter(nFilter)
fsEnableGetSamples()
fsDisableGetSamples()
Array=fsGetSamples(MAXSAMPLES,NewSamplesInArray)
or
NewSamplesInArray=fsGetSamples2(Array)
Tool
Tempfile$ = fsGetTempFile()
Create a system wide unique temporary filename