0
0

This is what I want to do

[code:12kbcn7n]LineIN/Mic >—— DSP/Plugin \
>— Out
MP3 >—— DSP/Plugin /[/code:12kbcn7n]

I did LineIn > Output in FMod3 like code below, but how to do it in Fmod Ex ?

[code:12kbcn7n]

‘VB6

Dim VUh As Single, VUv As Single
Dim VUh2 As Single, VUv2 As Single

Dim ErrRec As Integer

Samp1 = FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDLEN, FSOUND_STEREO Or FSOUND_16BITS, 44100, 220, 128, 255)

Call FSOUND_Record_SetDriver(0)
Call FSOUND_Sample_SetMode(Samp1, FSOUND_LOOP_NORMAL)
ErrRec = FSOUND_Record_StartSample(Samp1, True) > 0

If ErrRec = 0 Then MsgBox FSOUND_GetErrorString(FSOUND_GetError())

Dim playpos As Long, recordpos As Long, diff As Long

Static oldrecordpos As Long
Static oldplaypos As Long

oldplaypos = 0
oldrecordpos = 0

FSOUND_Stream_SetBufferSize 10000

channel9 = FSOUND_PlaySound(FSOUND_FREE, Samp1)
Call FSOUND_SetVolume(channel9, 0)
OriginalFreq = FSOUND_GetFrequency(channel9)

Do While Samp1

FSOUND_GetCurrentLevels channel9, VUv, VUh

DoEvents

playpos = FSOUND_GetCurrentPosition(channel9)
recordpos = FSOUND_Record_GetPosition()

DoEvents

If (playpos > oldplaypos) And (recordpos > oldrecordpos) Then

            diff = playpos - recordpos

            If diff > -RecDelSampl Then

            If UseFrekAdjust.Value = 1 Then Call FSOUND_SetFrequency(channel9, OriginalFreq - 1000) 'slow it down

            ElseIf (diff < -(RecDelSampl * 2)) Then

            If UseFrekAdjust.Value = 1 Then Call FSOUND_SetFrequency(channel9, OriginalFreq + 1000) 'speed it up

            Else

             If UseFrekAdjust.Value = 1 Then Call FSOUND_SetFrequency(channel9, OriginalFreq)

            End If

            If UseFrekAdjust.Value = 0 Then Call FSOUND_SetFrequency(channel9, OriginalFreq)

  End If

        oldplaypos = playpos
        oldrecordpos = recordpos

Sleep (100)
Loop

FSOUND_StopSound (channel9)
FSOUND_Record_Stop

[/code:12kbcn7n]

  • You must to post comments
0
0

Check out the recording and submixing examples. Your frequency adjustment code is fine and just needs to be ported to use FMOD Ex.

  • You must to post comments
0
0

I looked at rec sample but can’t realy figure it out. i.e “FSOUND_Sample_Alloc” is not in FmodEx, so I appreciate some help here.

Thanks!

  • You must to post comments
0
0

Read the documentation, particularly “Transitioning between FMOD3 and FMOD Ex Differences”. Use System::createSound instead of FSOUND_Sample_Alloc.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.