DirectSoundを使用してマイクからサウンドを取得しようとしています。ここに私のコードは次のとおりです。C#DirectSoundでの曖昧な呼び出し
using Microsoft.DirectX.DirectSound;
public MicrophoneSensor()
{
CaptureBufferDescription micBufferDesc = new CaptureBufferDescription();
WaveFormat format = new WaveFormat();
format.SamplesPerSecond = 22000;
format.Channels = 1;
format.BitsPerSample = 8;
format.AverageBytesPerSecond = 22000;
format.BlockAlign = 1;
micBufferDesc.Format = format;
micBufferDesc.BufferBytes = 100000;
micBufferDesc.ControlEffects = false;
micBufferDesc.WaveMapped = true;
micBuffer = new CaptureBuffer(micBufferDesc, microphone);
}
micBufferDescのインスタンス化とフォーマット変数は次のエラーをスローするには、Visual Studio 2008のを引き起こす:
The call is ambiguous between the following methods or properties: 'Microsoft.DirectX.DirectSound.CaptureBufferDescription.CaptureBufferDescription()' and 'Microsoft.DirectX.DirectSound.CaptureBufferDescription.CaptureBufferDescription()'
and
The call is ambiguous between the following methods or properties: 'Microsoft.DirectX.DirectSound.WaveFormat.WaveFormat()' and 'Microsoft.DirectX.DirectSound.WaveFormet.WaveFormat()'
私は名前空間を明記のかなりの数の異なる組み合わせを試してみたし、ステートメントを使うが運がない。
また、ソリューションエクスプローラの参照を確認して、重複がないことを確認できます。
Microsoft.DirectX.DirectSound参照のみを使用した新しいテストプロジェクトで、それ以外は同じエラーをスローしません。
また、DirectX SDK(2009年3月)とDirectX SDK(2008年11月)をアンインストールして再インストールしました。まだ運がありません。
最後に、研究所の別のコンピュータで新しいプロジェクトを試しましたが、まだ動作しません。
- グラフ
- Microsoft.DirectX.DirectSound
- Microsoft.DirectX.DirectInput
- PresentationCore
- PresentationFramework
- サービス
- システム:ここで
は、私が持っている参照です
- System.Core
- System.Data
- System.Data.DataSetExtensions
- System.Deployment
- System.Drawing
- System.Runtime.Serialization
- System.ServiceModel
- システム。 Windows.Forms
- System.Xml
- System.Xml.Linq
- UIAutomationProvider
- WindowsBase
- WindowsFormsIntegration
私はポストにいくつかの情報を追加しました。これは奇妙な問題です。 – JohnS