Exemplo n.º 1
0
        private void openButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.RestoreDirectory = true;
            openFileDialog1.Filter           = "All files (*.*)|*.*";
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            textBox1.Text = openFileDialog1.FileName;

            if (TeamTalk.GetMediaFileInfo(openFileDialog1.FileName, ref info))
            {
                if (info.audioFmt.nAudioFmt != AudioFileFormat.AFF_NONE)
                {
                    audioLabel.Text = String.Format("{0} Hz, {1}", info.audioFmt.nSampleRate,
                                                    (info.audioFmt.nChannels == 1 ? "Mono" : "Stereo"));
                }
                else
                {
                    audioLabel.Text = "Unknown";
                }

                if (info.videoFmt.picFourCC != FourCC.FOURCC_NONE)
                {
                    videoLabel.Text = String.Format("{0}x{1} FPS: {2}",
                                                    info.videoFmt.nWidth, info.videoFmt.nHeight, info.videoFmt.nFPS_Numerator);
                }
                else
                {
                    videoLabel.Text = "Unknown";
                }
            }
            else
            {
                info = new MediaFileInfo();
            }
        }