2013-02-19 6 views
1

all로 출력합니다. X-Fi 사운드 블래스터 카드를 통해 A/V 수신기와 인터페이스해야하는 프로젝트가 있습니다. A/V 수신기는 7.1 스피커 시스템에 연결됩니다. 시뮬레이터에서 항공기 조종실 정보를 지시 할 수 있도록 7.1 채널 각각에 개별적으로 액세스하는 방법을 처음부터 알고 싶습니다. 나는 OpenAL을 사용하고 있으며 C에서이 코드를 작성하고있다. 나는 트릭을해야한다고 생각하는 코드를 개발했지만, 다른 6 명의 스피커에서 오디오가 흘러 나오고있다. 아래는 이미 작성한 일부 코드 샘플입니다. 나는 누군가가 나를 도울 수 있기를 바랍니다.OpenAL을 사용하여 특정 채널의 사운드를 7.1

감사합니다. 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; 

}`

답변

0

가 나는 같은 문제에 직면하고있다. 나는 왼쪽이나 오른쪽 귀에 음색을 연출하고 싶다. 내가 지금까지 발견 한 유일한 방법은 사운드로 스테레오 버퍼 (7.1 버퍼)를 생성 한 다음 다른 채널 (다른 7 개 채널)의 정보를 0으로 덮어 쓴 다음 다시 재생하는 것입니다. 청취자 앞의 출처에서.

이것은 내 해결 방법입니다. 나는 그것이 서툴 킨다는 것을 안다. 그러나 openAL에 있고 ALSA (Linux의 경우) 또는 CoreAudio (Mac의 경우)를 사용하여 직접 프로그래밍하는 것을 피하려면 더 좋아지지 않습니다.

질문에 대한 직접적인 답변 : 아니요, 직접 말하려는 방식이 아닌 것 같습니다. "3 번 연자는 'Hello World'라고 말하면서 다른 모든 연사는 침묵을 지킵니다."

건배,

파리 드