eukalyptus Posted March 1, 2009 Share Posted March 1, 2009 Hi, why don't you use Global variables for the DLL-Handles? Then the funktion calls would be a lot easier Vote 4 Global DLL´sbecause it´s easier to translate from other languages.E DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
UEZ Posted March 12, 2009 Share Posted March 12, 2009 (edited) Is it possible to display channel levels (L/R) from sound card when another program is producing the sound output?E.g. when mediaplayer or other source is playing a mp3 and I just want to display channel levels, e.g with GDI+ Visualization: Analog Meter I wrote?If yes, how?Sorry, but I'm not so familiar with bass.dll Thanks,UEZPS: nice job Edited March 12, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
eukalyptus Posted March 12, 2009 Share Posted March 12, 2009 on most soundcards you can capture the output. you have to choose an input called "What you hear" or "Stereomix" or something like that! (= $BASS_INPUT_TYPE_WAVE flag ?!?) #include "Bass.au3" #include "BassConstants.au3" #include <WinAPI.au3> $bassdll = DllOpen(@ScriptDir & "\bass.dll") _BASS_SetConfig($bassdll, $BASS_CONFIG_REC_BUFFER, 1000) _BASS_RecordInit($bassdll, -1) $Cnt = 0 $Name = _BASS_RecordGetInputName($bassdll, 0) While $Name <> "" $Input = _BASS_RecordGetInput($bassdll, $Cnt) If BitAND($Input[0], $BASS_INPUT_TYPE_WAVE) Then _BASS_RecordSetInput($bassdll, $Cnt, $BASS_INPUT_ON, 1) $Cnt += 1 $Name = _BASS_RecordGetInputName($bassdll, $Cnt) WEnd $RecHandle = _BASS_RecordStart($bassdll, 44100, 2, _WinAPI_MakeLong(0, 10)) GUICreate("BassTest", 220, 50) $hMeterLeft = GUICtrlCreateProgress(10, 10, 200, 18, 1) $hMeterRight = GUICtrlCreateProgress(10, 30, 200, 18, 1) GUISetState() While GUIGetMsg() <> -3 $Level = _BASS_ChannelGetLevel($bassdll, $RecHandle) $LevelL = _WinAPI_LoWord($Level) * 100 / 32768 $LevelR = _WinAPI_HiWord($Level) * 100 / 32768 GUICtrlSetData($hMeterLeft, $LevelL) GUICtrlSetData($hMeterRight, $LevelR) Sleep(5) WEnd E DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
UEZ Posted March 12, 2009 Share Posted March 12, 2009 on most soundcards you can capture the output. you have to choose an input called "What you hear" or "Stereomix" or something like that! (= $BASS_INPUT_TYPE_WAVE flag ?!?) #include "Bass.au3" #include "BassConstants.au3" #include <WinAPI.au3> $bassdll = DllOpen(@ScriptDir & "\bass.dll") _BASS_SetConfig($bassdll, $BASS_CONFIG_REC_BUFFER, 1000) _BASS_RecordInit($bassdll, -1) $Cnt = 0 $Name = _BASS_RecordGetInputName($bassdll, 0) While $Name <> "" $Input = _BASS_RecordGetInput($bassdll, $Cnt) If BitAND($Input[0], $BASS_INPUT_TYPE_WAVE) Then _BASS_RecordSetInput($bassdll, $Cnt, $BASS_INPUT_ON, 1) $Cnt += 1 $Name = _BASS_RecordGetInputName($bassdll, $Cnt) WEnd $RecHandle = _BASS_RecordStart($bassdll, 44100, 2, _WinAPI_MakeLong(0, 10)) GUICreate("BassTest", 220, 50) $hMeterLeft = GUICtrlCreateProgress(10, 10, 200, 18, 1) $hMeterRight = GUICtrlCreateProgress(10, 30, 200, 18, 1) GUISetState() While GUIGetMsg() <> -3 $Level = _BASS_ChannelGetLevel($bassdll, $RecHandle) $LevelL = _WinAPI_LoWord($Level) * 100 / 32768 $LevelR = _WinAPI_HiWord($Level) * 100 / 32768 GUICtrlSetData($hMeterLeft, $LevelL) GUICtrlSetData($hMeterRight, $LevelR) Sleep(5) WEnd E Thanks for your example but it is not working on my Toshiba notebook No L/R levels! I will test it also on my other Dell notebook later (tomorrow?). UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
BrettF Posted March 12, 2009 Author Share Posted March 12, 2009 Works for me Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
BrettF Posted March 12, 2009 Author Share Posted March 12, 2009 I have some CDDB-UDFs, if you want to include them. OK, then it will be this way. Then i have 2 funcs for easier loding of DLLs, with checking for success. I use such funcs in all my UDFs which need DLLs, so you can react on missing DLLs. Func _BASS_LoadDLL($Path,$DLL) ; Prog@ndy If StringLen($Path) And StringRight($Path,1)<>"\" Then $Path &= "\" Local $ret = DllOpen($Path & $DLL) If Not __BASS_CheckLoadDLL($DLL) Then Return SetError(1,0,-1) EndIf Return $ret EndFunc ; internal use Func __BASS_CheckLoadDLL($DLL) ; Prog@ndy Local $ret = DllCall("kernel32.dll","ptr","GetModuleHandleW","wstr",$DLL) If @error Or $ret[0]=0 Then Return False Return True EndFuncI'm still a bit confused on how to implement it Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
UEZ Posted March 13, 2009 Share Posted March 13, 2009 (edited) Mmmhhh, it is also not working on my Dell notebook!When put the line ConsoleWrite(@error & " : " & $Name & @CRLF) just after $Name = _BASS_RecordGetInputName($bassdll, 0) before While $Name <> "" loop Iget following output:0 : Master VolumeIt that the value which is expected?I'm using hasta la Vista x32!UEZ Edited March 13, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
eukalyptus Posted March 13, 2009 Share Posted March 13, 2009 Mmmhhh, it is also not working on my Dell notebook! When put the line ConsoleWrite(@error & " : " & $Name & @CRLF) just after $Name = _BASS_RecordGetInputName($bassdll, 0) before While $Name <> "" loop I get following output: 0 : Master Volume It that the value which is expected? I'm using hasta la Vista x32! UEZ What I´ve done is to check the flag of each input. If the flag = $BASS_INPUT_TYPE_WAVE then this input is the right one to capture the output (I thought ) please put this line: ConsoleWrite($Cnt & " " & $Name & " " & $Input[0] & @LF) after $Input = _BASS_RecordGetInput($bassdll, $Cnt) and post the result. E DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
UEZ Posted March 13, 2009 Share Posted March 13, 2009 The output is: 0 Master Volume 50331648But I got a peak when I comment out the lines starting from $Cnt = 0 until WEnd and add after WEnd _BASS_RecordSetInput($bassdll, 0, $BASS_INPUT_TYPE_WAVE, 1)!That's the microphone input!Thanks,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
eukalyptus Posted March 13, 2009 Share Posted March 13, 2009 This is my result:0 CD-Lautstärke 839516161 Mikrofon 503971842 Line-Lautstärke 336199683 Stereomix 167772160"Stereomix" is the right oneplease try my recorder-software and check if it detects all inputs correctly (start recorder -> config).http://www.autoitscript.com/forum/index.php?showtopic=86639 DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
UEZ Posted March 13, 2009 Share Posted March 13, 2009 (edited) Here the screenshots of my device:Only 2 Audio Devices!ASIO is empty.UEZPS: screenshots removed due to low attachments space! Edited April 15, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
BrettF Posted March 13, 2009 Author Share Posted March 13, 2009 Everything says there should be a stero mix to me... I get 0 CD Volume 83951616 1 Line Volume 33619968 2 Mic Volume 50397184 3 Stereo Mix 167772160 but I will sit back and let euka do his thing, as he knows more about this than me Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
eukalyptus Posted March 13, 2009 Share Posted March 13, 2009 Ok - it´s Vista bassforum: I guess you're referring to changing the active input via BASS_RecordSetInput? If so, I'm afraid that is not possible as Vista presents each input as a separate device. If you do not have a StereoMix-device, you can´t capture the output, I think... Maybe there is an other way on Vista?!? DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
UEZ Posted March 13, 2009 Share Posted March 13, 2009 (edited) Ok - it´s Vista bassforum: I guess you're referring to changing the active input via BASS_RecordSetInput? If so, I'm afraid that is not possible as Vista presents each input as a separate device. If you do not have a StereoMix-device, you can´t capture the output, I think... Maybe there is an other way on Vista?!? Thanks for investigation! Let's wait for workaround... hasta la Vista baby Btw, nice application eukalyptus UEZ Edited March 13, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
ProgAndy Posted March 19, 2009 Share Posted March 19, 2009 (edited) I'm still a bit confused on how to implement it I saw this right now and have an update for it You won't need extra funcs to load DLLs anymore, since AutoIt checks the DLL-Load error itself since 3.3.0.0 But if you use Global Variables for them, like i recommend, it is useful to load DLLs with a function: Global $_BASS_BASSDLL=-1 Func _BASS_LoadDLL($DLLFile="bass.dll") ; Prog@ndy If $_BASS_BASSDLL > -1 Then Return $_BASS_BASSDLL Local $ret = DllOpen($DLLFile) If $ret = -1 Then Return SetError(1,0,-1) Global $_BASS_BASSDLL = $ret Return $ret EndFunc Func _BASS_UnloadDLL() ; Prog@ndy If $_BASS_BASSDLL > -1 Then DllClose($_BASS_BASSDLL) $_BASS_BASSDLL = -1 Return True EndIf Return False EndFunc //Edit: and use similar functions for each BASS-plugin. Edited March 19, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
UEZ Posted March 20, 2009 Share Posted March 20, 2009 (edited) I get back negative values on some MP3' using the _BASS_ChannelGetLevel() function (range 0-0x7FFF is exceeded to value 0x8000):Here for left channel:...118511316012649121361441232028-32768250422066223209194702129718689169442514019822-3276826505221652339320573157231631115859...I saw on my Analog Meter that the left channel moves to the left bottom sometimes on some MP3s (code already fixed)!Is this a bug in the bass.dll?UEZ Edited March 20, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
eukalyptus Posted March 21, 2009 Share Posted March 21, 2009 (edited) Bass returns left & right channels in loword and hiword... try this code to show the problem: #include <WinApi.au3> $X=32768 $Y=32768 $Z=_WinAPI_MakeLong($X, $Y) ConsoleWrite($Z & " " & _WinAPI_HiWord($Z) & " " & _WinAPI_LoWord($Z) & @LF) E Edited March 21, 2009 by eukalyptus DirectSound UDF Direct2D UDF Link to comment Share on other sites More sharing options...
UEZ Posted March 21, 2009 Share Posted March 21, 2009 Bass returns left & right channels in loword and hiword... try this code to show the problem: #include <WinApi.au3> $X=32768 $Y=32768 $Z=_WinAPI_MakeLong($X, $Y) ConsoleWrite($Z & " " & _WinAPI_HiWord($Z) & " " & _WinAPI_LoWord($Z) & @LF) E I know this already but I though that both values for l/r should be in the same range-> 0x0000 - 0x7FFF but bass.dll return also 0x8000 which causes negative value for high word only. Is this a bug? UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
flxfxp Posted May 6, 2009 Share Posted May 6, 2009 It worked/s great! However, with newer versions of Autoit I get the following error: : ERROR: $error previously declared as a 'Const' $error = _BASS_ErrorGetCode($bass_dll) if I comment out the error line it works fine, but it would be better to fix it for debugging purposes. How do I fix this error? Thanks, Dennis Link to comment Share on other sites More sharing options...
BrettF Posted May 6, 2009 Author Share Posted May 6, 2009 Can you post the exact error please? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now