mmaudio2.hsp

sample\mmaudio\mmaudio2.hsp » Plain Format

#use strict
#use mod_mmaudio

;	mod_mmaudioモジュールサンプル(2)
;	(Windows Vista以降で動作します)
;	チャンネルごとのピーク値を取得してレベルメーターを表示します

	maxch=GetMeteringChannelCount()
	if maxch<0 : dialog "Function Failed" : end	; エラーが発生した
	ddim peak,maxch
repeat
	redraw 0
	color 255,255,255 : boxf

	GetChannelsPeakValues peak,maxch		; チャンネルごとのピーク値を取得する
	if stat<0 : dialog "Function Failed" : end	; エラーが発生した
	repeat maxch
	x=cnt*50
	i=int(peak(cnt)*100)
	color 255,0,0 : boxf x, 100-i, x+20, 100
	color 0,0,0:pos x,105:mes i
	loop

	redraw 1
	await 1000/30
loop