Update: 20.08.08
NOW: Version 1.0 !Features:- load .WAV, .MP2, .MP3, .OGG, .RAW -files and play it.
- get current time in minutes/seconds by BYREF ( FM_GetTime(Samplehandle, BYREF minutes, BYREF seconds)
- get spectrum data ( FM_DSPGetSpectrum(spec[], num_Specs = 256) // for mixrate 44100: DIM Spec[256] , num_specs = 256 !)
- get songname
- set volume
- get IsPlaying ( FM_IsPlaying(Samplehandle) )
Next Features:
- set loops
- pause-function
- set FX <---- thats a hard part !!!
- Linux/Mac Support
Screenshot:
(http://www.glbasic.com/forum/index.php?action=dlattach;topic=2248.0;attach=250;image)
like this:
SYSTEMPOINTER TRUE
LOCAL Init = FM_Init()
LOCAL Sample = FM_LoadSample("DHS - IK+ (Chemical Stadium Remix).mp3",FSOUND_NORMAL)
LOCAL Play = FM_PlaySound(Sample)
LOCAL FFT = FM_DSPGetFFTUnit()
FM_DSPSetActive(FFT)
LOCAL Spec[]
DIM Spec[256]
LOCAL Vol = 255
WHILE TRUE
LOCAL minutes, seconds,i
INC Vol, MOUSEAXIS(2)*5
IF Vol > 255 THEN Vol = 255
IF Vol < 0 THEN Vol = 0
FM_GetTime(Sample, minutes, seconds)
PRINT "FMod-Wrapper v1.0, only for GLBasic.com!",10,10
PRINT "by Schranz0r", 10,30
PRINT "Songname: "+FM_GetName$(Sample),10,50
PRINT "IsPlaying: "+FM_IsPlaying(Sample),10,70
PRINT "Volume(use mouseweel): "+Vol,10,90
PRINT "Samplelength: "+FM_GetLength(Sample),10,110
PRINT "CurrentPos: "+FM_GetCurrentPosition(Sample),10,130
PRINT "Song in Sec: "+FM_GetLengthInSeconds(Sample),10,150
PRINT "Current Position in Sec: "+FM_GetCurrentPositionInSeconds(Sample),10,170
IF seconds < 10
PRINT "Time: "+ minutes+":0"+seconds, 10,190
ELSE
PRINT "Time: "+ minutes+":"+seconds, 10,190
ENDIF
FM_DSPGetSpectrum(Spec[])
FOR i = 0 TO LEN(Spec[])-1
IF Spec[i] > 0.5 THEN Spec[i] = 0.5
IF Spec[i] < 0 THEN Spec[i] = 0
DRAWLINE 100+i, 400, 100+i, 400-Spec[i]*500, RGB(i, 255-i, 0)
NEXT
FM_SetVolume(Sample,Vol)
IF FM_IsPlaying(Sample) AND MOUSEAXIS(3) THEN FM_StopSound(Sample)
IF FM_IsPlaying(Sample) = 0 AND MOUSEAXIS(4) THEN FM_PlaySound(Sample)
SHOWSCREEN
WEND
FM_Close()
END
You can see, thats very simple (thats the goal). My wrapper contains a channel, filename and soundfile handling!
Download it NOW (link broken! -> old Post :) )
[attachment deleted by admin]
Wow! Klasse Sache. ... I mean class thing =D
Excellent. :good:
Cheers
ist jetzt schon ein wenig weiter :)
evtl kommt morgen ein Update ;)
Schranz0r, was planst dunoch für den Wrapper? Funktionen mit denen man diverse Aspekte der geladenen Musik auslesen und verwerten kann (Stichwort: Musikspiele) wären toll! Umso mehr, da z.B. auch Guitar Hero ja Fmod benutzt und demenstprechende Funktionen enthalten sein müssten. Ich hab mich schon an irrKlang versucht aber so viel OOP :S
Man kann wohl den Höhenausschlag abfragen stichwort Audiosurf :D
Muss mal gucken wie das genau geht:)
Bin schon ein wenig weiter, werde evtl morgen nochmal ein Update raufladen ;)
Genau darauf wollte ich hinaus. Hab nämlich eine Idee für ein Musikspiel und da käme mir ein Fmod Wrapper natürlich grade recht :whistle:
Looking good!
Will I be able to load an mp3 file and start playing at any location inside the mp3?
yes ;)
You can set a start-endpoint for a loop
ect..
Great, I want an audiobook player than can remember where you were on quit. Is it running on GP2X? ;-)
no, i wrapp the fmod.dll :/
ah, ok. Still interesting for listening to audiobooks on the PC but sadly not possible for GP2X then. Looking forward for the finnished version :-)
UPDATE! See first Post ;)
Schranz0r, wenn das auch noch auf dem Pandora läuft... gut, ein Held bist du eh schon, aber: :nw:
just awesome... :S :good:
Muhahahaha! Super Arbeit. :good:
Uber wrapper, well done! :D
Thx guys :-[
Hast du echt klasse gemacht. :good:
Ja, wie man sieht, hast du viel von mir gelernt. ;) Nein nicht schlagen! :whip: :whip: Ich glaub, ich versteck mich jetzt lieber erst mal für paar Stunden. =D
Cheers
:nana:
Schau dir gut den Code an Bee.. evtl kannst du noch was lernen ;)
Achja -> :noggin: :whip:
Hehe
Klar, kann da bestimmt noch was lernen.:) Wenn ich das nächste mal zu dir komm gibst du mir eine kleine Unterrichtsstunde. Oder Nee doch nicht. Lieber eine runde Bowling auf der Wii. Und danach ein Aktien Hell. :booze:
Cheers
Quote from: BumbleBee on 2008-Aug-21
...
Oder Nee doch nicht. Lieber eine runde Bowling auf der Wii. Und danach ein Aktien Hell. :booze:
Cheers
So ists richtig!
The link is gone, can someone re-upload it, somewhere, please.. thanks..
Is the Fmod Wrapper Still Avaible :nw:
One can be found in the Samples directory!
Uploading old version for matchy since the original file seems unaccessible.
[attachment deleted by admin]
Thank-you Moru but that does not contain DSPGetSpectrum and, seriously, I can't believe no-one has it. :noggin:
I'll have to see if I can find my old Fight Tune game, as that used the spectrum analyser...
grr i hate it when this happens......crash on execute
// --------------------------------- //
// Project: FMod Wrapper
// Start: Friday, August 15, 2008
// IDE Version: 5.348
Is this the only version for glbasic?
Any ideas why it is crashed in windows xp?