Basic4GL
« [16] FreeSound Plugin for Basic4GL »

Welcome Guest. Please Login or Register.
Jul 30, 2010, 5:10pm




Basic4GL :: BASIC4GL Boards :: DLL/Plugin Creation :: [16] FreeSound Plugin for Basic4GL
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: [16] FreeSound Plugin for Basic4GL (Read 2,687 times)
DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 734
Location: Germany NRW Essen
 [16] FreeSound Plugin for Basic4GL
« Thread Started on Dec 1, 2007, 5:37am »

Get FreeSoundPlugin if you like.
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

Joshy

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

for a list of all commands see next post

Joshy
« Last Edit: Dec 26, 2009, 1:22am by DJLinux »Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 734
Location: Germany NRW Essen
 short desription of the FreeSound Plugin.
« Reply #1 on Dec 1, 2007, 9:51am »

FreeSound Plugin Commands


Section Plugin

fsSetPlugPath("path",len("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)
Load a mp3 file in the pool of waves hWave return it's handle

fsLoadOGGFile("file.ogg",hWave)
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 beween 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 object.

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)

Joshy
« Last Edit: Dec 26, 2009, 1:20am by DJLinux »Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
James :) (aka Madcow)
Posts heaps :)
*****
member is offline

[avatar]

Sup



Joined: Mar 2006
Gender: Male
Posts: 1,735
Location: UK
 Re: FreeSound Plugin for Basic4GL V0.3
« Reply #2 on Dec 1, 2007, 10:43am »

one word amazing

p.s maybe you could make the orge engine as a plugin once you've finished this!
« Last Edit: Dec 1, 2007, 10:47am by James :) (aka Madcow) »Link to Post - Back to Top  IP: Logged

- James

There are 10 types of people in the world: Those who understand binary, and those who don't...
DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 734
Location: Germany NRW Essen
 Re: FreeSound Plugin for Basic4GL V0.3
« Reply #3 on Dec 2, 2007, 6:57pm »


Quote:
one word amazing

thank you for this nice comment :)

Quote:
p.s maybe you could make the orge engine as a plugin once you've finished this!
I could i'm an programmer ;) but i have no time and fun to do it.
By the way C++ is a better choice if you willl use ORGE.

Joshy
Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
Empyrion Martyr
Posts a lot
****
member is offline

[avatar]

[yim] [msn]

Joined: Jan 2007
Gender: Male
Posts: 347
Location: Bucharest, Romania
 Re: FreeSound Plugin for Basic4GL
« Reply #4 on Dec 30, 2007, 10:04am »

Joshy, i have to repeat that... amazing indeed!
Vielen Dank für diese .dll
Link to Post - Back to Top  IP: Logged

Omnis vulnerat, ultima necat...
El_Dorado
Posts
**
member is offline

[avatar]

Your Time Has Come

[yim] [aim]
[homepage]

Joined: Jan 2008
Gender: Male
Posts: 65
Location: Hades
 Re: FreeSound Plugin for Basic4GL
« Reply #5 on Jan 18, 2008, 1:58pm »

This is one awesome plugin.

I'm thinking about using it for FreeMP3... As far as I can go now is low-quality MP3/WAV, so high quality MP3 would be nice. But, the added size might not be worth it... I'm trying to keep in under 2 megs.
Link to Post - Back to Top  IP: Logged

The Bucket Fan Club founding member.
dodic
Global Moderator
*****
[image]
member is offline

[avatar]



Joined: Dec 2005
Gender: Male
Posts: 661
 Re: FreeSound Plugin for Basic4GL
« Reply #6 on Feb 4, 2008, 6:06pm »

Great job ^^ It's really very useful.
« Last Edit: Feb 4, 2008, 6:06pm by dodic »Link to Post - Back to Top  IP: Logged

[image]
Darn Serbian connections getting slower every day :P

www.silkroadonline.co.cc
Supermonkey
Global Moderator Plus
*****
member is offline

[avatar]



Joined: Jul 2003
Gender: Male
Posts: 1,200
Location: UK
 Re: FreeSound Plugin for Basic4GL
« Reply #7 on Mar 7, 2008, 3:14pm »

You my friend are an exetremely talented programmer and your plugins are very helpful.

excellent work!
Link to Post - Back to Top  IP: Logged

Tom Mulgrew
Administrator
*****
member is offline

[avatar]

[msn]
[homepage]

Joined: Jul 2003
Gender: Male
Posts: 497
 Re: FreeSound Plugin for Basic4GL
« Reply #8 on Mar 7, 2008, 5:45pm »

So far I've seen plugins:
ODE
FreeSound
Joystick
Networking

Have I missed any?

(Tried your C64 emulator. Very impressive for 8 hours work.)
Link to Post - Back to Top  IP: Logged
Tom Mulgrew
Administrator
*****
member is offline

[avatar]

[msn]
[homepage]

Joined: Jul 2003
Gender: Male
Posts: 497
 Re: FreeSound Plugin for Basic4GL
« Reply #9 on Mar 8, 2008, 5:23am »

Joshy, would you be willing to license your plugins under the revised BSD license? http://en.wikipedia.org/wiki/BSD_license
The reason I ask is that I'm thinking of putting Basic4GL under that license, and uploading it onto sourceforge.
Link to Post - Back to Top  IP: Logged
DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 734
Location: Germany NRW Essen
 Re: FreeSound Plugin for Basic4GL
« Reply #10 on Mar 8, 2008, 11:41am »

Tom@

yes you can use this licence.

Joshy

« Last Edit: Dec 25, 2009, 10:18am by DJLinux »Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 734
Location: Germany NRW Essen
 Re: [16] FreeSound Plugin for Basic4GL
« Reply #11 on Dec 25, 2009, 9:30am »

can anywhere test the current version of FreeSoundPlugin on VISTA and 7 please ?

thank you

Joshy
Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
aphoticgenesis
Posts a bit
***
member is offline

[avatar]



Joined: Apr 2009
Gender: Male
Posts: 114
Location: United States
 Re: [16] FreeSound Plugin for Basic4GL
« Reply #12 on Dec 25, 2009, 8:41pm »

djlinux are you using FMOD for the sound plugin, if not its the best system for sound, it was used to make Call of Duty: Modern Warfare 2!!!!

http://fmod.org/

:)
Link to Post - Back to Top  IP: Logged
DJLinux
Global Moderator Plus
*****
member is offline



\_/?


[homepage]

Joined: Apr 2008
Gender: Male
Posts: 734
Location: Germany NRW Essen
 Re: [16] FreeSound Plugin for Basic4GL
« Reply #13 on Dec 25, 2009, 8:51pm »

i don't need BASS, FMOD, SDL, ALLEGRO and friends
my lib is mutch more faster (hand optimized SSE and MMX assembler)
and it never crashed if you have multipy sound devices
i'm a hobby musican and have 4 sound devices
1 onboard AC97
1 PCI DMX Fire 1024
1 USB Beringer U-control UCA 202
1 USB ZOOM G2.1U

with this configuration FMOD was crashed sometimes
same with Basic4GL sound lib

and my lib works perfect on Linux too

do you have test it on Vista or 7 and found any problem?
(i need this info i have only XP and Linux)

thanx Joshy
« Last Edit: Dec 25, 2009, 8:57pm by DJLinux »Link to Post - Back to Top  IP: Logged

(sorry for my bad English)
I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong.
Wayne Rayner
Posts heaps :)
*****
member is offline

[avatar]

September 2010 will be the greatest.

[msn]
[homepage]

Joined: Nov 2008
Gender: Male
Posts: 707
Location: Australia
 Re: [16] FreeSound Plugin for Basic4GL
« Reply #14 on Dec 26, 2009, 1:11am »

Nice joshy,
Sounds like you are interested in sound a lot and it is obvious why you have put so much effort into this plugin. I will run it and check it on vista and tell you if it has any problems. Also I have looked at FMOD and I don't like it. At the moment I'am good at using B4GL sound plugin but I have attempted yours and seems to work quite well.

I like it how you have made so many plugins that has (how do I say) expanded the possibilities of Basic4GL.

Thank You for your hard work which has benn used by everyone

Yours
Wayne Rayner
Link to Post - Back to Top  IP: Logged

Yours
Wayne Rayner

Design - Development - Testing - not working - Development - Testing - not working - Development - I'm bored.

I love you my love

   [Search This Thread][Send Topic To Friend] [Print]

Google
Webbasic4gl.proboards.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile