Question

I am using DirectSound to record voice and save in binary code.

var problem = _dwCapBuffer.Read(offset, typeof(byte), LockFlag.None, _dwOutputBufferSize);
#"problem" is byte array arrcording to http://msdn.microsoft.com/en-us/library/windows/desktop/bb280844.aspx

but when I use "problem" in function like private string ByteArray_to_Hex(byte[] data) ByteArray_to_Hex(problem), it show the error

the best overload method....has some valid argument

How can I solve this problem ( use the return value of CaptureBuffer.Read as byte[] ) ?

Was it helpful?

Solution

According to the documentation, it's not returning a byte array but an Array.

Just type ByteArray_to_Hex(problem) and let Visual Studio generate the method. Then you'll see what type it returns. Perhaps you can call ByteArray_to_Hex((byte[])problem) to explicitly cast it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top