Ejemplo n.º 1
0
        public static String GenerateCaptureDeviceItem(int itemId, CaptureDevice captureDevice, String uri)
        {
            int sampleRate = captureDevice.MMDevice.AudioClient.MixFormat.SampleRate;

            /* The channels and bitDepth are fixed, as requested from the WasapiLoopbackCapture2
             * in LoopbackModule.Start(). */
            int channels = 2;
            int bitDepth = 16;
            int bitRate  = sampleRate * channels * (bitDepth / 2) * 8;

            return(DidlUtil.GetMusicItem(itemId + "", "0", "1",
                                         captureDevice.Name, "N/A", "N/A", "N/A", "0",
                                         bitRate + "", sampleRate + "", channels + "", bitDepth + "",
                                         StreamingFormat.DefaultFormat.GetNetworkFormatDescriptor(sampleRate, channels),
                                         uri, "object.item.audioItem.musicTrack"));
        }
        private String GenerateCaptureDeviceEntry(int itemId, CaptureDevice captureDevice, String url)
        {
            int sampleRate = captureDevice.MMDevice.AudioClient.MixFormat.SampleRate;

            /* The channels and bitDepth are fixed, as requested from the WasapiLoopbackCapture2
             * in LoopbackModule.Start(). */
            int channels = 2;
            int bitDepth = 16;
            int bitRate  = sampleRate * channels * (bitDepth / 2) * 8;

            return(DidlUtil.GetMusicItem(itemId + "", "0", "1",
                                         captureDevice.Name, "N/A", "N/A", "N/A", "0",
                                         bitRate + "", sampleRate + "", channels + "", bitDepth + "",
                                         "http-get:*:audio/L16;rate=" + sampleRate + ";channels=" + channels + ":DLNA.ORG_PN=LPCM",
                                         url, "object.item.audioItem.musicTrack"));
        }