tous. J'ai un projet où j'ai besoin d'interfacer avec un récepteur A/V via une carte son blaster X-Fi. Le récepteur A/V est connecté à un système d'enceintes 7.1. Je voudrais connaître la façon de commencer à accéder à chacun des canaux 7.1 individuellement afin que je puisse diriger l'information d'habitacle d'avion dans un simulateur. J'utilise OpenAL et je suis en train d'écrire ce code en C. J'ai développé du code que je pensais devoir faire l'affaire, mais je suis en train de perdre du son sur les 6 autres enceintes. Voici un exemple de code que j'ai déjà écrit. J'espère que quelqu'un peut m'aider ici.Utilisation de OpenAL pour émettre un son vers un canal spécifique à un 7.1.
Merci, Vincent.` { ALuint NorthWestSource; ALint PlayStatus;
switch (event)
{
case EVENT_COMMIT:
//Load user selected .wav file into the buffer that is initialized here, "InitBuf".
LoadDotWavFile();
//Generate a source, attach buffer to source, set source position, and play sound.
alGenSources(NumOfSources, &NorthWestSource);
ErrorCheck();
//Attach the buffer that contains the .wav file's data to the source.
alSourcei(NorthWestSource, AL_BUFFER, WavFileDataBuffer);
ErrorCheck();
//Set source's position, velocity, and orientation/direction.
alSourcefv(NorthWestSource, AL_POSITION, SourcePosition);
ErrorCheck();
alSourcefv(NorthWestSource, AL_VELOCITY, SourceVelocity);
ErrorCheck();
alSourcefv(NorthWestSource, AL_DIRECTION, SourceDirectionNorthWest);
ErrorCheck();
alSourcei(NorthWestSource, AL_SOURCE_RELATIVE, AL_TRUE);
ErrorCheck();
alSourcei(NorthWestSource, AL_CONE_INNER_ANGLE, 180);
ErrorCheck();
alSourcei(NorthWestSource, AL_CONE_OUTER_ANGLE, 270);
ErrorCheck();
SetCtrlVal(panelHandle, PANEL_SOURCEISSET, 1);
//Play the user selected file by playing the sources.
alSourcePlay(NorthWestSource);
ErrorCheck();
//Check that the .wav file has finished playing and if so clean things up.
do
{
alGetSourcei(NorthWestSource, AL_SOURCE_STATE, &PlayStatus);
if(PlayStatus != AL_PLAYING)
{
printf("File done playing. \n");
}//End do-while if statement
}
while(PlayStatus == AL_PLAYING);
//Clean things up more before exiting out of this audio projection.
alDeleteSources(NumOfSources, &NorthWestSource);
ErrorCheck();
alDeleteBuffers(NumOfBuffers, &WavFileDataBuffer);
ErrorCheck();
SetCtrlVal(panelHandle, PANEL_SOURCEISSET, 0);
//alDeleteBuffers(NumOfBuffers,
break;
}
return 0;
} `