概要
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());
}
}
}
以上。