0
0

fmod’s version is 3.72.
at first:
FSOUND_Init(22050, 64, FSOUND_INIT_GLOBALFOCUS+FSOUND_INIT_ENABLESYSTEMCHANNELFX);
……
Fsound_stream_open(PChar(opendialog1.Files[Index]),FSOUND_MPEGACCURATE, 0, 0);
second:
FSOUND_SetPaused(-1000, true);
EQ[1]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[2]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[3]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[4]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[5]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[6]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[7]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[8]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[9]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
EQ[10]:= FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
//FSOUND_FX_Enable(-1000, FSOUND_FX_PARAMEQ);
case(sender as ttbarmy).Tag of
1:begin
FSOUND_FX_SetParamEQ(EQ[1], 80, 18, EQ01.Position-15);
end;
2:begin
FSOUND_FX_SetParamEQ(EQ[2], 170, 18, EQ02.Position-15);
end;
3:begin
FSOUND_FX_SetParamEQ(EQ[3], 300, 18, EQ03.Position-15);
end;
4:begin
FSOUND_FX_SetParamEQ(EQ[4], 600, 18, EQ04.Position-15);
end;
5:begin
FSOUND_FX_SetParamEQ(EQ[5], 1000, 18, EQ05.Position-15);
end;
6:begin
FSOUND_FX_SetParamEQ(EQ[6], 3000, 18, EQ06.Position-15);
end;
7:begin
FSOUND_FX_SetParamEQ(EQ[7], 6000, 18, EQ07.Position-15);
end;
8:begin
FSOUND_FX_SetParamEQ(EQ[8], 12000, 18, EQ08.Position-15);
end;
9:begin
FSOUND_FX_SetParamEQ(EQ[9], 14000, 18, EQ09.Position-15);
end;
10:begin
FSOUND_FX_SetParamEQ(EQ[10], 16000, 18, EQ10.Position-15);
end;

 end;
 FSOUND_SetPaused(-1000, false);

notice:-1000=Fsound_systemchannel.
why?Please help me!thanks a lot!

  • You must to post comments
0
0

Just some additional notes:

Buffersize should be set to 100
InitialiseFlag should be dimensioned as boolean, although this may not be used in your code and could be omitted.

  • You must to post comments
0
0

I want to try it through software.And before Fmod_init,I have set the buffer 200.I have read the document for many times.And i use Fsound_stream_play to play the mp3 songs.why?can anyone help me?

  • You must to post comments
0
0

Hi
Try this !

{ Initialize FSOUND }
FSOUND_SetMixer(FSOUND_MIXER_QUALITY_FPU); // Float point CPU
FSOUND_SetOutput(FSOUND_OUTPUT_DSOUND); // DirectX sound
FSOUND_SetDriver(0); // sound card (0 = default)
FSOUND_SetBufferSize(100); // Buffer size

FSOUND_SetPaused(-1000, TRUE); // Stop FX channel

ID:=Fsound_FX_Enable(-1000,7); // Slider 1
ID1:=Fsound_FX_Enable(-1000,7); // Slider 2
ID2:=Fsound_FX_Enable(-1000,7); // Slider 3…
.
.
.
Fsound_Setpaused(-1000,False); // Restart FX Channel

fsound_FX_SetParamEQ(ID,100,18,Sliderposition); // Slider 1 adjust
fsound_FX_SetParamEQ(ID1,200,18,Slider1position); // Slider 2 adjust
fsound_FX_SetParamEQ(ID2,600,18,Slider2position); // Slider 3 adjust

This should work

Leo

  • You must to post comments
0
0

thanks.It works well!

  • You must to post comments
0
0

I too am having trouble with the EQ, I have tried code similar to what was posted, but I can’t seem to get a successful FX ID:

.FXID = FSOUND_FX_Enable(.Channel, FSOUND_FX_PARAMEQ)

This is called on a paused channel:

.Channel = FSOUND_Stream_PlayEx(FSOUND_FREE, .Handle, 0, True)

And the channel plays the song fine, but the FX_Enable code returns a (-1) no matter what I try.

  • You must to post comments
0
0

Hi,
Which version are you using? With the latest 3.73 release the following init seems to work well and allows EQ to work.

hope this helps

Leo

PS have a look at the online help system here about setting up FX

[url:3gh7acz2]http://www.fmod.org/forum/viewtopic.php?t=839[/url:3gh7acz2]

//________________________________________________

FMOD_Load(nil);

{ Check version numbers }
if FMOD_VERSION > FSOUND_GetVersion then
begin
Application.MessageBox(PChar(Format(‘API version %3.2f is newer than DLL version %3.2f’, [FMOD_VERSION, FSOUND_GetVersion])), ‘Version mismatch’, MB_OK or MB_ICONERROR);
Halt;
end;

{ Initialize FSOUND }
try
if not FSOUND_SetOutput(FSOUND_OUTPUT_DSOUND) then
raise Exception.Create(‘FSOUND_SetOutput failed’);
if not FSOUND_SetDriver(0) then
raise Exception.Create(‘FSOUND_SetDriver failed’);
if not FSOUND_SetMixer(FSOUND_MIXER_QUALITY_AUTODETECT) then
raise Exception.Create(‘FSOUND_SetMixer failed’);
if not FSOUND_SetHWND(Handle) then
raise Exception.Create(‘FSOUND_SetHWND failed’);
if not FSOUND_SetBufferSize(256)then
raise Exception.Create(‘Buffer Size error’);
except
Application.MessageBox(FMOD_ErrorString(FSOUND_GetError), ‘Initialization’, MB_OK or MB_ICONHAND);
raise;
end;
//FSOUND_Init(22050, 32,FSOUND_ENABLEFX or FSOUND_INIT_GLOBALFOCUS ) then
if not FSOUND_Init(22050, 128, FSOUND_INIT_ENABLESYSTEMCHANNELFX or FSOUND_INIT_GLOBALFOCUS or FSOUND_NORMAL) then
begin
Application.MessageBox(FMOD_ErrorString(FSOUND_GetError), ‘FSOUND_Init’, MB_OK or MB_ICONHAND);
Halt;
end;

// __________________________________________________

  • You must to post comments
0
0

I have looked at the post that was mentioned earlier:

http://52.88.2.202/forum/viewtopic.php?t=839

But I have not been able to get the EQ to work still, in VB6. Does anyone have a simple sample project or VB6 source code that successfully utilizes the EQ in VB6? I am using FMOD 3.73

Thanks!!!

  • You must to post comments
0
0

Set up 11 Sliders called EQSlider(0) – (10).
EQSlider(0) will not be used and set as visible = false. Crap way that I’ve done it but it works for me!
Slider values are all Min -15 Max 15

‘Ensure Variables are set
Public Eq(0 To 10) As Long
Public Gain As Single
Public Center As Single
Public WhichIndex
Public SetEQs

‘Initialise FMOD
Private Sub Initialise()
Dim result As Boolean
Call FSOUND_SetBufferSize(BufferSize)
result = FSOUND_Init(44100, 32, FSOUND_INIT_ENABLESYSTEMCHANNELFX + FSOUND_INIT_GLOBALFOCUS)
If Not result Then
MsgBox “An error occured initializing fmod!” & vbCrLf & _
FSOUND_GetErrorString(FSOUND_GetError), vbOKOnly
InitialiseFlag = False
Exit Sub
End If
InitialiseFlag = True
SetSystemChannel ‘Set the System Channel – See code lower down
StopProg = False
End Sub

Private Sub SetSystemChannel()
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, True
InitEq (FSOUND_SYSTEMCHANNEL) ‘See code lower down
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, False
End Sub

‘In the PlayStream set the FX EQ Values by inserting this routine to the Play routine

Private Sub cmdPlayStream_Click()
For WhichIndex = 1 To 10
GetEQValues
Next WhichIndex

‘Moving the EQSlider
Private Sub EQSlider_MouseMove(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
WhichIndex = index
GetEQValues ‘See code lower down
End If
End Sub

Private Sub InitEq(ByVal streamChannel As Long)
On Error Resume Next
If streamChannel Then
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)

End If
End Sub

Private Sub GetEQValues()
Select Case WhichIndex
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
Gain = EQSlider(WhichIndex)
Call FSOUND_FX_SetParamEQ(Eq(WhichIndex), Center, 18, Gain)
End Sub

If anybody knows an easier way of doing it please let me know.

Also, beware if using an SB Live card!!

Hope it helps – TBE

  • You must to post comments
0
0

OO!! Thank you! I will try this, see if I can get it to work!!

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.