0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

cscの作法 その185

Posted at

概要

cscの作法、調べてみた。
managed directxやってみた。
directsound、やってみた。
録音してみた。

参考にしたページ

サンプルコード

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using System.IO;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.DirectX;
using Microsoft.DirectX.DirectSound;

namespace mdx
{
	public partial class Form1 : Form {
		CaptureSound cap;
		public Form1() {
			this.Text = "DirectSound";
			this.Load += new EventHandler(this.Form1_Load);
			Button btn1 = new Button();
			btn1.Location = new Point(140, 40);
			btn1.Size = new Size(80, 20);
			btn1.Text = "START";
			btn1.Click += btn1_Click;
			Controls.Add(btn1);
			Button btn2 = new Button();
			btn2.Location = new Point(140, 110);
			btn2.Size = new Size(80, 20);
			btn2.Text = "STOP";
			btn2.Click += btn2_Click;
			Controls.Add(btn2);
			Console.WriteLine("ok0");
		}
		private void Form1_Load(object sender, EventArgs e) {
			cap = new CaptureSound();
			Console.WriteLine("ok1");
		}
		private void btn1_Click(object sender, EventArgs e) {
			cap.startRecord(this);
			Console.WriteLine("start");
		}
		private void btn2_Click(object sender, EventArgs e) {
			cap.stopRecord();
			Console.WriteLine("stop");
		}
		[STAThread]
		public static void Main() {
			Application.Run(new Form1());
		}
	}
}





以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?