This project has moved and is read-only. For the latest updates, please go here.

NSpeex.SpeexDecoder' does not contain a constructor that takes '1' arguments

Oct 17, 2011 at 3:08 AM

Newbie NAudio user.  Downloaded the sources and am trying to build the NAudioDemo projects in VS2008 on a WinXP SP3 machine.  Got past the 'linq' not recognized problem by adding System.Core as a reference.  However, I still have the following build error

 

NSpeex.SpeexDecoder' does not contain a constructor that takes '1' arguments

The class definition shows:

    public class SpeexDecoder   

{       

public SpeexDecoder(BandMode mode, bool enhanced);
public int FrameSize { get; }       

public int SampleRate { get; }
public int Decode(byte[] inData, int inOffset, int inCount, short[] outData, int outOffset, bool lostFrame);   

}

 

Anyone have a clue what I'm doing wrong here?

 

TIA

 

Frank

 

 

But the code shows 

 

        public SpeexChatCodec(BandMode bandMode, int sampleRate, string description)       

{           

this.decoder = new SpeexDecoder(bandMode);           

this.encoder = new SpeexEncoder(bandMode);           

this.recordingFormat = new WaveFormat(sampleRate, 16, 1);           

this.description = description;           

this.encoderInputBuffer = new WaveBuffer(this.recordingFormat.AverageBytesPerSecond); // more than enough       

}

Oct 17, 2011 at 10:25 AM

I would recommend downloading Visual Studio 2010 express to build NAudio, which is a free product.

Oct 17, 2011 at 2:40 PM
markheath wrote:

I would recommend downloading Visual Studio 2010 express to build NAudio, which is a free product.

 

Thanks for the quick reply.  I got VS2010Express and now the NAudioDemo product builds successfully.
While I have your ear (eye?), my application requires that I produce one of two simple tones, depending on the results of a test measurement that is taken about 5 times/second.  Any suggestions where to start with NAudio - is there an example that is close that I can use as a starting point?
FWIW, I do this now with the 'Beep(frequency_hz, duration_ms)' function in VS2008, but this directly accesses the PC speaker and doesn't allow control of volume or output device selection.
TIA,
Frank
Oct 17, 2011 at 3:36 PM

I did a blog post a while back on creating sine waves with NAudio. That would be a good place to begin.

http://mark-dot-net.blogspot.com/2009/10/playback-of-sine-wave-in-naudio.html

Mark

Oct 17, 2011 at 5:28 PM

Mark,

 

Thanks!  I have that post, and I'm working on a project using it.  I'm sure I'll have more questions ;-).

 

Frank