Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            LibUSBProvider provider = new LibUSBProvider();
            var            testd    = provider.FindDevices(0x1d50, 0x60a1)[0];

            testd.OpenDevice();

            var b     = new LibSDR.Components.IO.USB.UsbBuffer(512);
            int testr = testd.BulkTransfer(LibSDR.Components.IO.USB.UsbTransferDirection.READ, 0x01, b, 1000);


            AirSpyDevice device = AirSpyDevice.OpenDevice(provider);

            device.StartRx();
            device.SampleRate = 10000000;
            //device.SampleRate = 3000000;

            if (true)
            {
                device.CenterFrequency = 93700000;
                device.SetLinearGain(6 / 21f);
            }
            else
            {
                device.CenterFrequency = 144430000;
                device.SetLinearGain(2 / 21f);
            }

            test = new WavFileWriter(new FileStream("F:\\test.wav", FileMode.Create), (int)device.SampleRate, 2, LibSDR.Components.IO.SampleFormat.Short16, 1 << 16);

            UnsafeBuffer buffer = UnsafeBuffer.Create(1 << 16, out Complex * bufferPtr);

            while (true)
            {
                int read = device.Read(bufferPtr, 1 << 16, 1000);
                test.Write(bufferPtr, read);
                test.FinalizeFile();
            }
        }
Ejemplo n.º 2
0
 private static void Device_OnSamples(LibSDR.Components.Interfaces.IRadioDevice device, Complex *ptr, int count)
 {
     test.Write(ptr, count);
     test.FinalizeFile();
 }
 public void ClosePipe()
 {
     wav.FinalizeFile();
 }