pk78

Hello,

Has anyone managed to port the "A full-duplex audio player in C# using the waveIn/waveOut APIs" - http://www.codeproject.com/cs/media/cswavrec.asp, to Compact Framework


Thanks



Re: .NET Compact Framework Full Duplex Audio Player

wimpos

Yes I did Smile
It is not that difficult.

  • Make a new project (c# -> mobile -> Class Library) en copy past all the files from the codeproject voice.dll.
  • rename mmdll in WaveNative from winmm.dll to coredll.dll
Compile and use

kind regards


W




Re: .NET Compact Framework Full Duplex Audio Player

pk78

Wimpos, thats what I did! I made the new project and have only renamed the dll. The project compiles and runs, but the sound heard is very bad and has a lot of noise..
I use the following settings
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, 16384, 3, new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, 16384, 3, new WaveLib.BufferDoneEventHandler(DataArrived));

I tried changing the frequency, bits and channel, bufferSize and bufferCount but the result is the same bad..

What I make wrong Have to change something else expect renaming the winmm.dll I have a Mio P550, WM5 if that helps...

PK







Re: .NET Compact Framework Full Duplex Audio Player

wimpos

I have a HTC TyTN WM5

I also changed the waveformat to the format of a telephone line:

Code Block

WaveFormat fmt = new WaveFormat(/*Samplefrequency*/ 8000, /*bitrate*/ 16, /*channels*/1);



Buffersize has no effect on quality, I have noise to, but the quality is good enough for
transfering voice

Kind Regards




Re: .NET Compact Framework Full Duplex Audio Player

pk78

I tried this format(8000,16,1) too but the problem remains Sad
Also, I noticed that the speaker repeats what I record from the beginning, its like a loop expect the noise.
So maybe the problem is in the FifoStream





Re: .NET Compact Framework Full Duplex Audio Player

wimpos

try to use a headset
there is no Acoustic Echo Cancellation implemented. This means that everything that comes from the speakers is transmitted again through the mike which is than again played by the speakers -> mike ...
giving the loop






Re: .NET Compact Framework Full Duplex Audio Player

pk78

Thanks W, it seems that this is the problem..Is there a way to cancel acoustic echo





Re: .NET Compact Framework Full Duplex Audio Player

Ilya Tumanov

Considering it's the first time you've heard of acoustic feedback probably not (not to mention device CPU might be not powerful enough for it). Half duplex might be a better option, see this.






Re: .NET Compact Framework Full Duplex Audio Player

pk78

I see, thanks Ilya. It seems that the best choice at this time is using headset Smile