Nabend
Gibt es einen Möglichkeit die Anzahl der ausgegebenen Bässe zu messen?
Also um die BPM (Beats per minute) in etwa zu berechnen
Nabend
Gibt es einen Möglichkeit die Anzahl der ausgegebenen Bässe zu messen?
Also um die BPM (Beats per minute) in etwa zu berechnen
Hi,
jo das geht mit der BASS DLL. eukalyptus hat mir mal ein Beispiel gemacht.
Sehr geil
Großen Dank
Hi,
ich hab das mal mit einer UI verbunden, klappt auch super, nur gibt es ein Problem mit nem Label. Und zwar kann er die BPM nicht im Label anzeigen bzw. er ändert das Label erst garnicht:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include "Bass.au3"
#include "BassFX.au3"
#Region ### START Koda GUI section ### Form=C:\Program Files (x86)\AutoIt3\Koda\Forms\bpm.kxf
$Form1 = GUICreate("Form1", 465, 158, 192, 124)
$Button1 = GUICtrlCreateButton("Exit", 8, 112, 451, 33)
$Button2 = GUICtrlCreateButton("Durchsuchen", 8, 16, 139, 17)
$Label1 = GUICtrlCreateLabel("Label1", 152, 16, 308, 25)
$Progress1 = GUICtrlCreateProgress(8, 48, 446, 17)
$Label2 = GUICtrlCreateLabel("BPM: ", 8, 80, 105, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Exit
Case $Button2
_BASS_Startup()
___DeBug(@error, "load bass.dll")
_BASS_FX_Startup()
___DeBug(@error, "load bassfx.dll")
_BASS_Init(0)
___DeBug(@error, "bass init")
$sFile = FileOpenDialog("Open...", "", "playable formats (*.MP3;*.MP2;*.MP1;*.OGG;*.WAV;*.AIFF;*.AIF)")
___Debug($sFile = "", $sFile)
GUICtrlSetData($Label1,$sFile) ;klappt
$hStream = _BASS_StreamCreateFile(False, $sFile, 0, 0, $BASS_STREAM_DECODE)
___DeBug(@error, "create decoding stream")
$iBytes = _BASS_ChannelGetLength($hStream, $BASS_POS_BYTE)
___DeBug(@error, "channel get length")
$iLength = _BASS_ChannelBytes2Seconds($hStream, $iBytes)
___DeBug(@error, "bytes to seconds")
$fBPM = _BASS_FX_BPM_DecodeGet($hStream, 0, $iLength, 0, 0, "_BPMPROCESSPROC")
___DeBug(@error, "BPM decode get")
$bpmfest ="BPM: " & Round($fBPM,2)
GUICtrlSetData($Label2,$bpmfest) ;klappt nicht auch sonst ändert er nix bsp. "Test"
MsgBox(0,"",$bpmfest) ; klappt
_BASS_StreamFree($hStream)
___DeBug(@error, "free stream")
_BASS_Free()
___DeBug(@error, "free bass")
EndSwitch
WEnd
Func _BPMPROCESSPROC($handle, $percent)
GUICtrlSetData($Progress1,Round($percent))
EndFunc ;==>_BPMPROCESSPROC
Func ___DeBug($iError, $sAction)
Switch $iError
Case -1
$Label2 = "-" & $sAction
Case -2
$Label2 = ">" & $sAction
Case 0
$Label2 = "+" & $sAction & " - OK"
Case Else
$Label2 = "!" & $sAction & " - FAILED, @error: " & $iError
Exit
EndSwitch
EndFunc ;==>___DeBug