Page 1 of 1

Needed Fmod pitchshift help

Posted: Tue Aug 08, 2006 8:32 pm
by Cor
using fmodex.dll latest stabel version.

This is what I have sofar but missing enums. can't get it to work.

Tips are welcome.

Code: Select all


#FMOD_INIT_NORMAL = $00000000 
#FMOD_HARDWARE = $00000020 
#FMOD_SOFTWARE = $00000040


#FMOD_LOOP_OFF = $00000001 
#FMOD_CHANNEL_FREE  = -1 

Enumeration
  #FMOD_DSP_PITCHSHIFT_PITCH 
  #FMOD_DSP_PITCHSHIFT_FFTSIZE 
  #FMOD_DSP_PITCHSHIFT_OVERLAP 
  #FMOD_DSP_PITCHSHIFT_MAXCHANNELS
 #FMOD_DSP_PITCHSHIFT
EndEnumeration


rval=OpenLibrary(0,"fmodex.dll") 
;Debug rval
CallFunction(0,"FMOD_System_Create", @system) 
CallFunction(0, "FMOD_System_Init", system, 32, #FMOD_INIT_NORMAL, 0) 
CallFunction(0, "FMOD_System_CreateSound", system, "ccr - suzie q.mp3", #FMOD_SOFTWARE | #FMOD_LOOP_OFF, 0, @sound) 

CallFunction(0, "FMOD_System_CreateDSPByType",System, #FMOD_DSP_TYPE_PITCHSHIFT, dspPitch)

sgPitchVal = 0.0 
CallFunction(0,"FMOD_DSP_SetParameter",dspPitch, #FMOD_DSP_PITCHSHIFT_PITCH, sgPitchVal)

CallFunction(0, "FMOD_Sound_SetMode", sound, #FMOD_LOOP_OFF) 

OpenWindow(0,0,0,100,100,"Player",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
CreateGadgetList(WindowID(0)) 
ButtonGadget  (1, 10, 10,80, 80, "Play sound") 

Repeat 
  EventID = WaitWindowEvent() 
  If EventID = #PB_Event_Gadget And EventGadget() = 1 
    CallFunction(0, "FMOD_System_PlaySound", system, #FMOD_CHANNEL_FREE, sound, 0, @channel) 
    CallFunction(0,"FMOD_Channel_AddDSP",@channel, dspPitch)
  EndIf 
Until EventID = #PB_Event_CloseWindow 

CallFunction(0, "FMOD_Sound_Release", sound) 
CallFunction(0, "FMOD_System_Close", system) 

CloseLibrary(0)
grCor

Posted: Wed Aug 09, 2006 3:40 am
by Fluid Byte
1.) What exactly is your question?
2.) You said you are missing "ENUMS", so values for FMOD Ex constant enumerations? If yes, wich exactly?
3.) The PB forums (although your are using the FMOD library from PB) are really the wrong place for such a question. You should seek help at the official FMOD forums.

Posted: Wed Aug 09, 2006 3:58 am
by Fluid Byte
Well, as I am a heavy user of the regular FMOD library I decided to install the FMOD Ex API and give your code a try. It didn't run on the first try because you are missing some constant enumerations (the ones you where asking for?) but it works when you add the following enums:

Code: Select all

Enumeration 
  #FMOD_DSP_TYPE_UNKNOWN
  #FMOD_DSP_TYPE_MIXER
  #FMOD_DSP_TYPE_OSCILLATOR
  #FMOD_DSP_TYPE_LOWPASS
  #FMOD_DSP_TYPE_ITLOWPASS
  #FMOD_DSP_TYPE_HIGHPASS
  #FMOD_DSP_TYPE_ECHO
  #FMOD_DSP_TYPE_FLANGE
  #FMOD_DSP_TYPE_DISTORTION
  #FMOD_DSP_TYPE_NORMALIZE
  #FMOD_DSP_TYPE_PARAMEQ
  #FMOD_DSP_TYPE_PITCHSHIFT
  #FMOD_DSP_TYPE_CHORUS
  #FMOD_DSP_TYPE_REVERB
  #FMOD_DSP_TYPE_VSTPLUGIN
  #FMOD_DSP_TYPE_WINAMPPLUGIN
  #FMOD_DSP_TYPE_ITECHO
  #FMOD_DSP_TYPE_COMPRESSOR
  #FMOD_DSP_TYPE_SFXREVERB
EndEnumeration
But what is this code supposed to do anyway? If I interpret it correctly you initialize the FMOD Ex system, create an empty sound named "ccr - suzie q.mp3" and then playing it back with a simple window GUI. That correct?