1
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 5 years have passed since last update.

Windowsの音量をEmacsから制御する

Posted at

Emacsでコーディング中に音量を変更したくなったので書いてみました。

実際のボリュームコントロールには、mcvc.exeを使っています。
http://maglog.jp/mos-privpro/index.php?module=Article&action=ReaderDetail&article_id=10569

あとはmcvcを呼び出す関数を定義して、キーに割り当てるだけです。

.emacs
;; ボリューム
(defun volume-up ()
  (interactive)
  (call-process "mcvc.exe" nil nil nil "m+10")
  )

(defun volume-down ()
  (interactive)
  (call-process "mcvc.exe" nil nil nil "m-10")
  )

;; キーバインド
(global-set-key (kbd "C-;") 'volume-up)
(global-set-key (kbd "C-:") 'volume-down)

C-;、C-:でボリュームが変更できます。

1
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
1
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?