Hello,
I am trying to get the ASIO audio input so that I can stream via TCP. I have it working well with the WaveIn, but I'm only receiving static on the TCP client when I try the same thing with ASIO.
Thanks! Having a lot of fun experimenting with this.
-Mike
I am trying to get the ASIO audio input so that I can stream via TCP. I have it working well with the WaveIn, but I'm only receiving static on the TCP client when I try the same thing with ASIO.
void asioOut_AudioAvailable(object sender, AsioAudioAvailableEventArgs e)
{
if (s == null)
{
s = myList.AcceptSocket();
}
var samples = e.GetAsInterleavedSamples();
//lame attempt to convert to byte array
var byteArray = new byte[samples.Length * 4];
Buffer.BlockCopy(samples, 0, byteArray, 0, byteArray.Length);
//////
byte[] encoded = codec.Encode(byteArray, 0, byteArray.Length);
s.Send(encoded, SocketFlags.None);
writer.WriteSamples(samples, 0, samples.Length);
}
I think my problem is 2 fold:- the AsioSampleType is being set as int32LSB - I believe I need this as a 16 bit file. Do I have to dither this on the fly before sending?
-
Also, the e.GetAsInterleavedSamples(); is returning as a float array. How I convert to byte array?
Thanks! Having a lot of fun experimenting with this.
-Mike








