0
0

Hi to all. (Sorry for last post)
Im spanish user and have low English level.
This is my code to init Spectrum and FX

To init sound :

[code:2kwvj7bq]FSOUND_SetBufferSize 200
FSOUND_Stream_SetBufferSize 200
FSOUND_SetHWND Me.HWND
FSOUND_SetMixer FSOUND_MIXER_QUALITY_AUTODETECT
If FSOUND_Init(o, 32, FSOUND_INIT_GLOBALFOCUS Or FSOUND_INIT_ENABLEOUTPUTFX) = 0 Then
‘error
End if
[/code:2kwvj7bq]

Stoped and closed the stream turn to load and play sound :

[code:2kwvj7bq]
CANÇO = FSOUND_Stream_OpenFile(MP3, FSOUND_NORMAL Or FSOUND_MPEGACCURATE Or FSOUND_ENABLEFX, 0)

FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, True

CANAL = FSOUND_Stream_PlayEx(FSOUND_FREE, CANÇO, vbEmpty, True)

Dim i As Integer
Dim K() As String
Const N = “80|170|310|600|1000|3000|6000|12000|14000|16000”
K = Split(N, “|”)
For i = 0 To 9 Step 1
EQ(i) = FSOUND_FX_Enable(CANAL, FSOUND_FX_PARAMEQ)
FSOUND_FX_SetParamEQ EQ(i), CSng(K(i)), 18, EQU2(i).Value
Next

FSOUND_SetPaused CaNaL, False
[/code:2kwvj7bq]

This code disables Spectrum Analizer and play’s a unknow sounds

if me not use FSOUND_ENABLEFX when open the file Spectrum run’s perfect… And Equalizer logicaly is deactivated

please correct my code. Thanks :roll:

Note!! Im have found 1 [b:2kwvj7bq]Bug[/b:2kwvj7bq] in some 192 KBPS songs thats not return correctly the of song time in Milliseconds 😮

  • You must to post comments
0
0

Ok, I’ll explain it to you. I have successfully made use of the equalizer and FX functions with Spectrum analysis. Heres some sample code:

First you have to initialize FMOD with FSOUND_NORMAL, not HW3D or HW2D.

And also do not open a stream with FSOUND_ENABLEFX.

Initializing each EQ band:
[code:zeulbdid]

Eq(0) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(1) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(2) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(3) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(4) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(5) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(6) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(7) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(8) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(9) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Eq(10) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)

Call FSOUND_FX_SetParamEQ(Eq(0), 80, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(1), 170, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(2), 310, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(3), 600, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(4), 1000, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(5), 3000, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(6), 6000, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(7), 12000, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(8), 14000, 18, 0)
Call FSOUND_FX_SetParamEQ(Eq(9), 16000, 18, 0)

[/code:zeulbdid]

When you call FSOUND_Stream_PlayEX on the stream you have to call the EQ initiation function. And also set the FSOUND_Stream_PlayEX StartPaused attribute to false.

[code:zeulbdid]

FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, True
Channel = FSOUND_Stream_PlayEx(FSOUND_FREE, Stream, vbEmpty, False)
Call FSOUND_SetPaused(FSOUND_SYSTEMCHANNEL, True)
Init_EQ
Call FSOUND_SetPaused(FSOUND_SYSTEMCHANNEL, False)

[/code:zeulbdid]

To set each of the EQ bands:
[code:zeulbdid]
Gain = -sldEqualizer(Index).Value

Select Case Index
Case 0: Center = 80
Case 1: Center = 170
Case 2: Center = 310
Case 3: Center = 600
Case 4: Center = 1000
Case 5: Center = 3000
Case 6: Center = 6000
Case 7: Center = 12000
Case 8: Center = 14000
Case 9: Center = 16000
End Select

Call FSOUND_FX_SetParamEQ(Eq(Index), Center, 18, Gain)
[/code:zeulbdid]

I used a control array so that is what Index is for, in case you didn’t know.

That’s about it.

  • You must to post comments
0
0

Ok this enables Spectrum and equalizer but [b:2fnmdz7o]FSOUND_FX_SetParamEQ[/b:2fnmdz7o] returns 0 … Any idea??

Thanks for your time. 😕

  • You must to post comments
0
0

Yeah, thats the problem I’m having. I have to init the EQ after I play every time because when I enable FX (like chorus, and echo, etc.) the EQ is disabled for osme reason. Any thoughts? Thanks.

  • You must to post comments
0
0

[b:2cmgvp57]This is my final code :[/b:2cmgvp57]

Global Variables :
[code:2cmgvp57]Private EQ(10) as Long
[/code:2cmgvp57]

Init sound :
[code:2cmgvp57]FSOUND_SetBufferSize 150
FSOUND_Stream_SetBufferSize 100
FSOUND_SetHWND Player.HWND
FSOUND_SetMixer FSOUND_MIXER_QUALITY_AUTODETECT
If FSOUND_Init(44100, 32, FSOUND_INIT_GLOBALFOCUS Or FSOUND_INIT_ENABLEOUTPUTFX) = 0 Then
‘ ERROR
End If
[/code:2cmgvp57]

Song’s Play :
[code:2cmgvp57]CANÇO = FSOUND_Stream_OpenFile(MP3, FSOUND_NORMAL OR FSOUND_MPEGACCURATE, 0)
FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, True
CANAL = FSOUND_Stream_PlayEx(FSOUND_FREE, CANÇO, VBEMPTY, FALSE)
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, TRUE
FSOUND_SetPriority FSOUND_ALL, 255
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, FALSE
[/code:2cmgvp57]

To activate/deactivate equalizer whit a Check button :
[code:2cmgvp57]If Check6.Value = 1 Then
Dim i As Integer
Dim K() As String
Const N = “80|170|310|600|1000|3000|6000|12000|14000|16000”
K = Split(N, “|”)
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, True
For i = 0 To 9 Step 1
EQ(I) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
FSOUND_FX_SETPARAMEQ EQ(I), CSng(K(I)), 18, 10
Next
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, False
Else
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, True
FSOUND_FX_Disable FSOUND_SYSTEMCHANNEL
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, False
End If
[/code:2cmgvp57]

When eaqualizer is activated this plays a unknown sounds and FSOUND_FX_SetParamEQ doesn’t run!!

My MP3 player VB source code and setup package is posted in my web page but is comented in “Catalan” …. [url]www22.brinkster.com/devildrey33[/url]

Thanks and Sorry for my low english.

[\DReY] 19/10/2002 – 19:15

  • You must to post comments
0
0

Maybe you should open the file in a different sub than when you play the file? I dont know anything about the unknown sounds you wrote about, it sounds interesting though :)

  • You must to post comments
0
0

I open the song and play it in the same function.
Please helpme!!!
When equalizer is enabled the output sound is corrupted.
Volume of original sound is more reduced and other sounds are mixed in the same song and this sounds have more volume than original sound.
And [b:1nwcfwxu]FSOUND_FX_SetParamEQ[/b:1nwcfwxu] returns 0!!
If you need to view my code Download it in [url]www22.brinkster.com/devildrey33/vbmp3player.zip[/url]

And follow this instructions:
1 Execute or make my project
2 Right click in player’s background and select Mask, Largest
3 Click in “Sound effects” label
4 Activate check button ….. and you can listen it.
(You need load a song in the list)

  • You must to post comments
0
0

In [url]www22.brinkster.com/devildrey33[/url] you can get MP3player Package but this is arround 4MB…..

Thanks. :)

  • You must to post comments
0
0

Im have loked your demo. And im have the same configuration … 😥
Please try to download this zip [url]www22.brinkster.com/devildrey33/mp3player.zip[/url] This contains a MP3player.exe. Move it into same directory of vbmp3player.zip and run it
Thanks.

  • You must to post comments
0
0

Sorry but my server doesnt accpet files more than 1MB

you can get “mp3player.exe” in “www22.brinkster.com/devildrey33/mp3player.zip” but this need VB6Runtime files …..

Thanks :)
(Note! FMOD 3.6.1 crashes in my mp3player)

  • You must to post comments
0
0

Hi!!
I have solved the problem!!!! :)

problem is my FSOUND_FX_MODES enum that not have all of enums…

Very thanks to you bret for your paciency whit me.

This works Exelent.

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.