Bonjour à tous, j'apprends en ce moment à utiliser Fmod et j'essaye de programmer mes premiers effets. Voici mon programme:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#include <fmod.h>
 
int main(int argc, char *argv[])
{
  int channel,channel2, echoid, echoid2;
  FSOUND_Init(44100, 32, 0);
  FSOUND_SAMPLE *tir = NULL;
  FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), 1); //analyseur spectral
  tir = FSOUND_Sample_Load(FSOUND_FREE, "coca.wav", 0, 0, 0);// chargement de mon son
 
  channel = FSOUND_PlaySoundEx(FSOUND_FREE, tir, NULL, 1);//mise en pause du son 
 
  echoid = FSOUND_FX_Enable(channel, FSOUND_FX_ECHO); // enable echo and get the first echo handle
  echoid2 = FSOUND_FX_Enable(channel, FSOUND_FX_ECHO); // enable echo again and get the second echo handle
  FSOUND_FX_Enable(channel, FSOUND_FX_FLANGER); // enable the flange effect, don't bother with the handle, we'll just use the default parameters<
 
  FSOUND_SetPaused(channel, 0); // now start the sound playing
 
  FSOUND_FX_SetEcho(echoid, 80.0f, 70.0f, 100.0f, 100.0f, 1); // Alter the parameters of the first echo for the channel it was enabled on. This handle is unique to this effect and this channel. The 2nd echo we enabled will be unaffected
 
 
  system("pause");
  FSOUND_Sample_Free(tir);
  FSOUND_Close();	
  return 0;
}
J'ai en grande partie recopié les exemples du tutoriel de Fmod (commentaires en anglais), et j'ai remplacé les "FALSE" et "TRUE" par des 0 et 1.

La compilation se passe bien mais j'entends mon son non modifié. Au débuggage, il apparait que echoid et echoid2 prennnent tous 2 la valeur -1, ce qui signifie que la fonction a échoué. Je n'ai pas d'autre indication. Le reste semble fonctionner.

L'analyseur spectral ne fonctionne pas non plus, ce qui est moins grave.

Quelqu'un a-t-il une proposition pour résoudre mon probléme?
Merci d'avance.