0
0

Is there an example somewhere on how to manage the FSOUND_FX_* functions, more specifically the Parametric EQ portion, on streams? (vb6)

  • You must to post comments
0
0

When I try to initialize a sound FX using:

EQ(i) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)

I am constantly recieving the FMOD error “FMOD_ERR_INVALID_PARAM”.

Any ideas 😕

Thanks

  • You must to post comments
0
0

I have this code in my media player and it work great, hope this will help you.
In the picturebox, it draw a curve to indicate where are the high and low zone.

[code:1alff9sp]
Dim Center(0 To 9) As Single
Dim Preset As Integer

Private Declare Function PolyBezier Lib "gdi32" (ByVal hdc As Long, _
lppt As POINTAPI, ByVal cPoints As Long) As Long

Private Type POINTAPI
X As Long
Y As Long
End Type


Private Sub Form_Load()
Center(0) = 80
Center(1) = 170
Center(2) = 310
Center(3) = 600
Center(4) = 1000
Center(5) = 3000
Center(6) = 6000
Center(7) = 12000
Center(8) = 14000
Center(9) = 16000
DessinerLignes
End Sub

Private Sub Init_EQ()
On Error Resume Next
Call FSOUND_SetPaused(FSOUND_SYSTEMCHANNEL, True)
For i = 0 To 9
EQ(i) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Next i
For i = 0 To 9
SliderControl1_MouseMove i + 0, True
Next i
Call FSOUND_SetPaused(FSOUND_SYSTEMCHANNEL, False)
End Sub

Private Sub Stop_EQ()
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, True
FSOUND_FX_Disable FSOUND_SYSTEMCHANNEL
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, False
End Sub

Private Sub SliderControl1_MouseMove(index As Integer)
FSOUND_FX_SetParamEQ EQ(index), Center(index), 18, -SliderControl1(index).Value
End Sub

Private Sub SliderControl2_MouseMove()
For i = 0 To 9
SliderControl1(i).Value = SliderControl2.Value
SliderControl1_MouseMove i + 0
Next i
End Sub

Private Sub DessinerLignes()
Picture1.Cls
For i = 0 To 9
XX = (i + 0.25) * (31 + 2 / 3)
Picture1.Line (XX, 0)-(XX, 46), RGB(150, 150, 150)
Next i
Picture1.Line (0, 22)-(301, 22), RGB(150, 150, 150)
Dim Arr(23) As Long
Arr(0) = -0.25 * (31 + 2 / 3)
Arr(1) = 15 * (3 / 2)
Arr(22) = 9.75 * (31 + 2 / 3)
Arr(23) = 15 * (3 / 2)
For i = 0 To 9
Arr((i * 2) + 2) = (i + 0.25) * (31 + 2 / 3)
Arr((i * 2) + 3) = (SliderControl1(i).Value + 15) * (3 / 2)
Next i
DrawBezierDiagram Picture1, Arr, 50
End Sub

Public Sub DrawBezierDiagram(dest As Object, PointArray As Variant, CurveSize As Long)
Dim i As Long
Dim BezierArray() As POINTAPI
Dim Middle As POINTAPI
Dim Difference As Long
Dim offset As Long
dest.ScaleMode = vbPixels
ReDim BezierArray(((UBound(PointArray) – 1) / 2 * 3))
For i = 0 To UBound(PointArray) – 2 Step 2
BezierArray((i \ 2) * 3).X = PointArray(i)
BezierArray((i \ 2) * 3).Y = PointArray(i + 1)
Middle.X = (PointArray(i) + PointArray(i + 2)) / 2
Middle.Y = (PointArray(i + 1) + PointArray(i + 3)) / 2
Difference = PointArray(i + 1) – PointArray(i + 3)
offset = CurveSize * Abs(Difference) / 100
If Difference < 0 Then
BezierArray((i \ 2) * 3 + 1).X = Middle.X
BezierArray((i \ 2) * 3 + 1).Y = Middle.Y – offset
BezierArray((i \ 2) * 3 + 2).X = Middle.X
BezierArray((i \ 2) * 3 + 2).Y = Middle.Y + offset
ElseIf Difference > 0 Then
BezierArray((i \ 2) * 3 + 2).X = Middle.X
BezierArray((i \ 2) * 3 + 2).Y = Middle.Y – offset
BezierArray((i \ 2) * 3 + 1).X = Middle.X
BezierArray((i \ 2) * 3 + 1).Y = Middle.Y + offset
ElseIf Difference = 0 Then
BezierArray((i \ 2) * 3 + 1) = Middle
BezierArray((i \ 2) * 3 + 2) = Middle
End If
Next i
BezierArray((i \ 2) * 3).X = PointArray(i)
BezierArray((i \ 2) * 3).Y = PointArray(i + 1)
Call PolyBezier(dest.hdc, BezierArray(0), UBound(BezierArray) + 1)
End Sub
[/code:1alff9sp]

If someone have ideas to improve the code, it could be great to know.

  • You must to post comments
0
0

How do you init Fmod ? Pass the FSOUND_INIT_ENABLEOUTPUTFX flag to FSOUND_Init if you are working with software channels.

  • You must to post comments
0
0

Awesome. That helps a lot. Thx. I wan’t aware of the FSOUND_SYSTEMCHANNEL const. Hence the “Newbie” status. (it also helps to real ALL the docs)

  • You must to post comments
0
0

Thanks for the hint!

I’m now passing this parameter, but it claims the following “Error creating hardware sound buffer”.

I am initiating FMOD with:

DirectSound Driver,
Flags: FSOUND_INIT_GLOBALFOCUS or FSOUND_INIT_ENABLEOUTPUTFX,
44100 in frequency,
64 Software channels

I am using my “SB Audigy Audio [FFE0]” driver.

Can anyone else please help me here?

Thanks in advance

  • You must to post comments
0
0

I’m curious why you chose (or if its required) to have a seperate FX handle for each EQ band…? Like, you have the variable array EQ:
[code:1ogyify0]
...
For i = 0 To 9
EQ(i) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Next i
...
FSOUND_FX_SetParamEQ EQ(index), Center(index), 18, -SliderControl1(index).Value
...
[/code:1ogyify0]
Couldn’t we just have a single global FX handle for every _SetParamEQ call? Thats the way I understood the docs…

  • You must to post comments
0
0

Found the issue, should have read the DX8 tutorial first.

Added FSOUND_SetBufferSize(100); before the call to init, and now everything works.

  • You must to post comments
0
0

I think it’s required but maybe not, all I kow is that it’s working like that. Maybe Brett could light us?

An other question:
How to draw a real equalizer line? The one that my program draw (see first reply) is only a curve but it only takes 16 value and it draw curves between them so it far for exactitude.

  • You must to post comments
0
0

How to identify wich FX you want to modifie ? Especially when you have more than one effect initialised :

[code:tua8yrde]
dim m_eqHandle as long

m_eqHandle = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
m_eqHandle = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_CHORUS)
[/code:tua8yrde]
Here, the second FSOUND_FX_Enable will override the first and FMOD will take the second handle in count. So, to be able to manage more than one effect per channel, FMOD must identifie each Fx them with their unique handle.[/code]

  • You must to post comments
0
0

Yes, but the remaining determining question, is each Parametric EQ setting considered a seperate effect? And if so, does that mean we’re limited to only 16 bands of parametric equalization?

  • You must to post comments
0
0

Yes, as EQ Param comes directly from DirectX, so you are limited to a 16 band EQ. If you want one more personal, you ll have to it yourself by using DSP Callbacks + FIR/FFT.

  • You must to post comments
0
0

yes, I did some experimenting, and I found out independantly that I need each EQ band on a seperate FX handle. But thanks for clearing that up :)

  • You must to post comments
0
0

You can use the excellent shibath EQ implementation and see the source code of how it is implemented in a player called foobar2000 :

http://shibatch.sourceforge.net
http://shibatch.sourceforge.net/eq/ <== algo comments
http://foobar2000.hydrogenaudio.org/SDK.zip <== look in the dsp_extra folder

Your program will have to be opensource (at least where you use the EQ code).

  • You must to post comments
0
0

Hello,

Just read this post and did implement (a Delphi version) of the example.
The problem is that I always recieves -1 when I call FSOUND_FX_Enable.

Are there any preconditions (drivers etc.) that must be valid before I can use DX8 effects?

Thanks,
Mikael

  • You must to post comments
Showing 14 results
Your Answer

Please first to submit.