0
0

Hello,
I’m working with VB6 and I’ve been using fmod.bas fmod_3.75. I have been able to reproduce the formats FLAC is the only music format where I did not obtain spectro graphics.
The other day I saw an fmod new version that is the Fmodex that can get the ‘reference of pointer’ to see the spectro.
I have been using the call to ‘FSOUND_DSP_GetSpectrum’ but in the fmodex version it does not exist.
The question is, which substitutes that call in fmodex?

THX.

  • You must to post comments
0
0

There is a new way to get a spectrum in FMOD Studio, you use an FFT DSP effect on your channel or channelgroup.

“System::getSpectrum and System::getWaveData removed
Add a custom DSP unit to capture DSP wavedata from the output stage. Use the master channelgroup’s DSP head with System::getMasterChannelGroup and ChannelControl::getDSP.
Add a built in FFT DSP unit type to capture spectrum data from the output stage. Create a built in FFT unit with System::createDSPByType and FMOD_DSP_TYPE_FFT, then add the effect to the master ChannelGroup with ChannelGroup::addDSP. Use DSP::getParameterData to get the raw spectrum data or use DSP::getParameterFloat to get the dominant frequency from the signal.”

More is here https://fmod.com/resources/documentation-api?page=content/generated/overview/transitioning.html#/

  • You must to post comments
0
0

Hi Thank you for answering,
These days I’ve been looking for examples, but unfortunately it’s all in C, and nothing about VB6, the only thing I’ve been able to do without success.

The variable ‘FMOD_DSP_TYPE_FFT’ is not in any ‘fmod_dsp.bas’ library and I had to add it in.
Public Enum FMOD_DSP_TYPE


FMOD_DSP_TYPE_FFT ‘ This unit simply analyzes the signal and provides spectrum
‘ information back through getParameter.
End Enum

This is what I could convert from C to vb6.
‘/////////////////////////////////////////////////////////
Dim system As Long
Dim dspEcho as long
Dim Channelgroup as long
Dim channel As Long
Dim SoundFile as String

Private Sub Form_Load()
Dim result As FMOD_RESULT
result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0)
result = FMOD_System_Create(system)
End Sub

Private Sub cmdPlay_Click()
SoundFile= App.Path & “\Name.flac”

    ' Create the stream
    result = FMOD_System_CreateStream(system,SoundFile, FMOD_2D Or 
                FMOD_SOFTWARE, sound)
    result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, 
                channel)
     Timer.Enabled = True

End Sub
‘///////////////////////////////////////////////////////////////////////////
And all this that I do not know if it’s okay.:

result = FMOD_System_SetSpeakerMode(system, FMOD_SPEAKERMODE_STEREO)
result = FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, 0)
result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_ECHO, dspEcho)
result = FMOD_System_GetMasterChannelGroup (System, Channelgroup)
result = FMOD_masterChannelGroup()
result = FMOD_System_CreateDSPByType(FMOD_DSP_TYPE_FFT,
FMOD_DSP_TYPE_NORMALIZE, system)
result = FMOD_System_GetSpectrum(system, Spectrum(0), 512, count,
FMOD_DSP_FFT_WINDOW_TRIANGLE)
result = FMOD_System_CreateDSPByType(FMOD_DSP_TYPE_FFT,
FMOD_DSP_TYPE_NORMALIZE, system)

If you like, I’ll attach the code so you can see the problem. Thank you.

  • brett

    FMOD_System_GetSpectrum does not exist, thats why the link below was provided.

    Also your parameters are all wrong. The system object is the first parameter for FMOD_System functions, then you do not add FMOD_DSP_TYPE_NORMALIZE to a createdsp function. look in the header and or the documentation and look at what you’re supposed to pass to each parameter.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.