Jump to content

Recommended Posts

Wow. I'm currently using Peace (just to reverse the channels resulting from an otherwise fine Y connector) and had no idea it was made outside of the huge libraries and compatibility of the Comp Sci classes.

Share this post


Link to post
Share on other sites
Posted (edited)

Is there support for multi lingual, GUI Internationalization / Translation ?

btw.
Thanks for this link ... and :welcome: to the forum.

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

11

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites

Thanks for welcoming me 😃

Yes, well not to the fullest extend. Any language can be used but it has to be a language from left to right, not from top to bottom like Chinese. I've incorporate a small translate window so people can easily translate from one language to another. Currently Peace has 8 languages: English, Dutch, German, French, Italian, Czech, Russian, Ukrainian. It's all voluntary work but much appreciated by the Peace community.

I've learnt c# and .net but somehow I find it less productive due to the complexity. My built-in language support is simply based on a text array and it fits the bill. Also Peace has support for themes but not all is possible. For instance buttons are always Windows ones. That's great about WPF and Visual Studio.

Share this post


Link to post
Share on other sites

@PeterVerbeek

Very interesting and nice work! Well done :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
10 minutes ago, PeterVerbeek said:

Dank je.

mmm ... another "dutchie" ;) 

Share this post


Link to post
Share on other sites

Pretty good job!


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

As this topic is meant to showcase the power of AutoIt, I'm wondering what to put in this topic. Any ideas?

I could put the change log in the post but it's very long. By now Peace has been updated almost 50 times. The only thing the change log makes clear it's an on-going project.

Share this post


Link to post
Share on other sites
52 minutes ago, PeterVerbeek said:

@Jos Jep, Dutchies like AutoIt. It's in their nature😉, though I don't know why 🤔. Enlighten me.

That's easy: We're cheap lazy bastards so we use the free great tools to get our stuff done for us. ;) 

Seriously: I am was using it "ages" ago for automating repetitive  tasks and some major global unattended software rollouts.... and somehow like the abuse I get around here. 🙂 

Jos

Share this post


Link to post
Share on other sites
1 hour ago, Jos said:

That's easy: We're cheap lazy bastards so we use the free great tools to get our stuff done for us. ;) 

Seriously: I am was using it "ages" ago for automating repetitive  tasks and some major global unattended software rollouts.... and somehow like the abuse I get around here. 🙂

🤣 So true.

Actually, I did use AutoIt because I was a bit lazy to learn Visual Studio, c#, .net and WPF. You see where it brought me. My project got a bit out of hand.🙄

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By nacerbaaziz
      hello sirs, i've created a tool to the blind users, this tool helps the blind to listen to a audio effect when moving between the GUIs controls on they computers
      where this tool can get the class for the current focus control and play a sound from a folder
      i've added all the knowne classes, but i found some problems i hope any one can help me.
      this is the code that i created

      #include <WinAPISys.au3> Global $h_CurrentHWNDFocus = "", $h_CurrentControlHWNDFocus = "" AdlibRegister("WindowAudioFocus", 50) Func WindowAudioFocus()     Local $h_NewHWNDFocus = WinGetHandle("[active]", "")     Local $h_NewControlHWNDFocus = ControlGetFocus($h_NewHWNDFocus, "")     If ($h_NewHWNDFocus = $h_CurrentHWNDFocus) And ($h_NewControlHWNDFocus = $h_CurrentControlHWNDFocus) Then Return 0     AdlibUnRegister("WindowAudioFocus")     If Not ($h_NewHWNDFocus = $h_CurrentHWNDFocus) Then         SoundPlay(@ScriptDir & "\focus_Audio\WindowChanged.wav")     Else         Switch _WinAPI_GetClassName(ControlGetHandle($h_NewHWNDFocus, "", $h_NewControlHWNDFocus))             Case "Button", "Start", "TrayButton", "TrayShowDesktopButtonWClass", "sbutton", "CirrussButton", "ODbcButton", "ThunderRTCommandButton", "ThunderSSOption", "ThunderSSCommand", "ThunderCommandButton", "ThunderRT6CommandButton", "ThunderRT5CommandButton", "TButton", "TBitBtn", "TAdvGlowButton", "ButtonWndClass", "afx:0:376:baa946", "_AOL_Button"                 If _IsCheckBox(ControlGetHandle($h_NewHWNDFocus, "", $h_NewControlHWNDFocus)) Then                     SoundPlay(@ScriptDir & "\focus_Audio\checkBox.wav")                 ElseIf _IsRadio(ControlGetHandle($h_NewHWNDFocus, "", $h_NewControlHWNDFocus)) Then                     SoundPlay(@ScriptDir & "\focus_Audio\radio.wav")                 Else                     SoundPlay(@ScriptDir & "\focus_Audio\button.wav")                 EndIf             Case "ComboBox", "ComboBoxEx32", "MSOBALLOONREComboBox20W", "REComboBox20W", "ThunderComboBox", "ThunderDriveListBox", "ThunderRT6ComboBox", "TORComboEdit", "TCombobox", "TComboBoxEx", "TORComboBox", "TColorBox", "TNFComboBox", "Internet Explorer_TridentCmbobx", "ComboWndClass", "_AOL_ComboBox", "ThunderRT5ComboBox", "ComboLBox"                 SoundPlay(@ScriptDir & "\focus_Audio\list.wav")             Case "Edit", "SearchBox", "TChatRichEdit", "_WwN", "_WwO", "RichEdit20A", "RichEdit20WPT", "RICHEDIT60W", "OKttbx", "RichEditA", "ThunderTextBox", "ThunderRT6TextBox", "ThunderRT5TextBox", "TEdit", "TRichEdit", "TRichEditViewer", "TMemo", "TInplaceEditList", "TLabeledEdit", "TMaskEdit", "TDateTimePicker", "TRichEdit", "TCaptionMemo", "TAddictRichEdit", "TCaptionEdit", "RichTextWndClass", "TextWndClass", "PasswordWndClass", "TextAreaWndClass", "MSWorksDoc", "_AOL_Edit", "SysDateTimePick32"                 SoundPlay(@ScriptDir & "\focus_Audio\edit.wav")             Case "ListBox", "ComboLBox", "REListBox20W", "SUPERGRID", "OUTEXVLB", "WMSUIVLB", "SchdmapiVLB", "VLBClass", "ThunderDirListBox", "ThunderFileListBox", "ThunderListBox", "ThunderRT6ListBox", "ThunderRT5ListBox", "TListbox", "TValueListEditor", "TORCalendar", "TColorListBox", "TCheckListBox", "Internet Explorer_TridentLstBox", "ListBoxWndClass", "ListWndClass", "hh_kwd_vlist", "afx:8:376:0:946", "_AOL_ListBox", "_AOL_Tree", ""                 SoundPlay(@ScriptDir & "\focus_Audio\List.wav")             Case "SysListView32", "OpenListView", "wuDuiListView", "ListView20WndClass", "TcxGridSite", "TListView", "TSystemListView", "ListViewWndClass", ""                 SoundPlay(@ScriptDir & "\focus_Audio\ListView.wav")             Case "SysTreeView32", "SearchTreeList", "FeatureTree", "TreeView20WndClass", "TSystemTreeView", "TTreeView", ""                 SoundPlay(@ScriptDir & "\focus_Audio\TreeView.wav")             Case Else                 SoundPlay(@ScriptDir & "\focus_Audio\focus.wav")         EndSwitch     EndIf     $h_CurrentHWNDFocus = $h_NewHWNDFocus     $h_CurrentControlHWNDFocus = $h_NewControlHWNDFocus     AdlibRegister("WindowAudioFocus", 50)     Return 1 EndFunc   ;==>WindowAudioFocus Func _IsCheckBox($ctrl_hwnd)     $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE)     Return BitAND($Style, $BS_CHECKBOX) = $BS_CHECKBOX EndFunc   ;==>_IsCheckBox Func _IsRadio($ctrl_hwnd)     $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE)     Return BitAND($Style, $BS_AUTORADIOBUTTON) = $BS_AUTORADIOBUTTON EndFunc   ;==>_IsRadio
      what i need from you is :
      play a sound when a menu item focus, that sound named menu.wav
      play a sound named items.wav when the users move on list box items or list view or treeview items or a combobox items
      please if can any one help me i'll very happy
      thanks on advance
    • By TheSaint
      This is my latest project, which I have been working on for a few days now, so this is kind of hot off the press. However, in reality, I have been working on some element of this for years. Some of you may remember a huge project of mine (Audio DVD Producer + Chat Blog Screenshots) that I worked on a good while back? Well, this one is very much related, and very much simpler in scope. That other project by the way, has been basically stalled for a good length of time now. Not because I never finished it, but because the end result was not as great as I hoped. I may share the files for it one day. I may even start working on it again one day, though this latest project kind of makes much of it redundant for my aims.
      Anyway, this project. I have a good bunch of DTS-CDs, from same or other sources (i.e. DVD). You can read more about what a DTS-CD is here, but the short of it, is that you cannot play them on a normal CD player, as you will just get noise. Many if not most DVD or Blu-ray players can play the embedded DTS data in the otherwise empty CD tracks. Further to that, a DTS-CD is essentially a compressed PCM or WAV file for all intents and purposes ... to keep things simple. So a 6 Channel (5.1) track takes up roughly the same amount of bytes as a normal stereo CD track ... so 6 channels for the price of 2.
      Up until recently, the best device for me to play the DTS-CDs on, as CDs, is my PS3. It plays them faithfully (reader issues aside) and has nice visuals. It is also my most convenient DVD/Blu-ray player, so a heap of hassle to play on one of my regular players, and not much success with the Xbox 360 ... at least with burnt backup copies.
      DTS-CDs are also kind of old school, and been superseded by the more superior lossless DVD Audio, Super CD and now Blu-ray Audio discs. That kind of makes them rare now and essentially irreplaceable, so being a wise man, I store them safely and only play backup discs.
      Playing discs though is kind of limited, and to be honest a pain, as my PS3 spits the dummy on some days, with the reader not being what its should be ... or perhaps poorly calibrated. So for a long time now, I have been wanting to use the backup files instead. Unfortunately, while I can play them fine on my PC (foobar2000 + DTS plugin), that is not where I want to listen to them. Until recently, neither my NeoTV 550 hardware player or my Laser one, have been very good at playing the files, and the PS3 even worse with its lack of file support. Back when I first investigated all this, and tried a bunch of things, and didn't yet have the Laser (4k Android) player, I did attempt to go the FLAC route. However, I was left unsatisfied, as my NeoTV did not support CUE files and M3U playlist files are a bit of a hassle ... and no help, when I have a single album file with cue index points for each track ... which many of my DTS-CD rips were ... especially for albums that have one track running into the next ... live albums too. The other issues for me with FLAC, were the artwork (album cover) and TAGS (details for each track - Title, Artist, Album, Year, etc), which I could not get to work.
      So, moving forward to recently. I played a DTS-CD on the PS3 the other day, and if there is one things I hate, it is a playing issue when I am in the midst of enjoying a nice piece of music. The PS3 is not very forgiving and just aborts play. I am not very forgiving of the PS3, so decided to investigate FLACs again. Now perhaps something has changed, since I last tried ... or I just wasn't on the ball. Anyway, to cut a long story a bit shorter, I loaded a DTS WAV file in foobar2000, and ripped it to a FLAC file. I then tried that file on my NeoTV 550 hardware player, and it played fine ... and some tags were visible, which surprised me. So I thought it was worth looking into further. I also tried the file on my Laser hardware player, with the Kodi (XBMC) Android app, but alas, while the Tags and Artwork worked well, all I got was noise ... and same for every other app I tried.
      Now don't ask me why I thought to try FLAC on its own, using the FLAC Frontend program initially, but I did ... and it recognized the tracks as 5.1. With foobar2000, I'd selected the decoder for DTS files when converting to FLAC, as I thought it was required. I hadn't at that stage used flac.exe by itself, but I decided to investigate the TAG command-line options and also noticed you could embed a picture, which I was keen as mustard to try. So I set up a BAT file and gave it a whirl.
      Now the results on my NeoTV 550 hardware player, were brilliant - Sound, Tags and Artwork were as I wanted. I decided to update Kodi at that point. Then, I tried my Laser hardware player again, but still no joy. I then did some online research and read about how to get it all working. Alas, I had mixed results. The foobar2000 ripped file worked, but the one I did with the BAT file did not. Not being keen to rip everything via foobar2000 menus, and wanting to code a quicker batch solution myself, I first attempted to see what command-line options I could use for foobar. That was a dismal failure, so I then revisited some of the programs I had used way back when with DTS WAV based files, and eventually discovered that 'valdec.exe' from the AC3Filter tools collection, gave the compatibility I needed. So I put my WAV or DTS files through that program first, then converted them to FLAC.
      Now the files played with DTS surround sound, on both my hardware players. They also play gapless, so I split album length files into separate track files, which avoids the CUE and M3U issues. That said, a joined M3U file for something like a (separate folders) double album, plays great with Kodi.
      So of course, I just had to whip up a program ... with drag and drop of course.
      And that program has steadily been growing & changing, and is where I want it now, at v1.5.
      Screenshots further below.
      REQUIRED COMPONENTS
      Most programs (if not all) can be obtained from VideoHelp, but here are some alternative sites to source them. The 'flac.exe' program is definitely required, and 'valdec.exe' if you want maximum compatibility support for a wider range of players.
      [flac.exe]
      https://xiph.org/flac/
      https://xiph.org/flac/download.html
      https://ftp.osuosl.org/pub/xiph/releases/flac/
      https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.1-win.zip
      [valdec.exe] [found in the AC3Filter tools collection]
      http://www.ac3filter.net/wiki/AC3Filter_tools (Info only, downloads no longer work)
      https://web.archive.org/web/*/http://www.ac3filter.net/wiki/AC3Filter_tools
      https://web.archive.org/web/20130623004920/http://www.ac3filter.net:80/wiki/Download_AC3Filter_tools
      If The Wayback Machine options fail, then go to VideoHelp (maybe go there anyway).
      https://www.videohelp.com/software/AC3-Filter/old-versions
      NOTE - The AC3Filter site has loads of information, which could help you enable other players aside from those below.
      RECOMMENDED PLAYERS
      PC = foobar2000 + DTS plugin component.
      Android Device = Kodi (XBMC) app with DTS etc enabled with passthrough.
      NOTE - foobar2000 with plugin, will play even those not processed with 'valdec.exe'. My 'NeoTV 550' hardware player does the same. My 'Laser' (Android device) with Kodi just emits noise with the FLAC files, if not processed with 'valdec.exe'.
      RECOMMENDED DTS-CD RIPPERS
      http://www.imgburn.com/
      http://www.exactaudiocopy.de/
      OTHER LINKS
      This one of mine tells you a lot more about DTS-CDs, including ripping or burning.
      https://forum.doom9.org/showthread.php?t=172484
      SCREENSHOTS
         

      P.S. I made a brilliant discovery today. Whereas in the past, with PS3 etc, I could not listen to my DTS-CDs via my Surround Sound Headphones, I now can with these files. So it is well worth playing those CDs as files, just for that benefit alone. Overall though, I have future proofed my collection.
    • By CYCho
      This file includes all the source codes and a compiled .exe version of zPlayer, which is a stand-alone, simple, intuitive and easy-to-use, yet fully functional audio player.  I made this to suit my purpose and you can tweak it to your taste as the source code is only about 1000 lines which are very much readable.  This player has the following functions:
      - Play back all formats of audio files which can be palyed back by the Windows Media Player in your computer
      - Graphical player similar to embedded Windows Media Player
      - Forward, backward, pause, repeat, shuffle funtions
      - Increase/decrease/mute sound volume
      - Change folders and create playlist for all audio files in that folder and its subfolders, and support for manually-made playlists
      - Save play-back environment when terminating and resume that environment when restarting
      - With one click, you can see DuckDuckGo search results for the file being played back
      - With a double-click, you can play back an item in the playlist
      - Search strings in the playlist
      - Option to see long file names including folder names
      - Resize the playlist window, and restore it to its default position
      - Very small footprint: very low CPU and memory usage, with only about 1MB when compiled
      - You can even hide all the windows and manipulate the player with hotkeys only
    • By CYCho
      zPlayer is the name I used when I introduced the early version of this palyer in my blog back in early 2009 and, therefore, has nothing to do with the mobile media player of the same name which started marketing in 2015.
      After I retired from active duty in 2002 I spent much time listening to music. First I started with CD's and LP's, then quickly moved on to mp3 files. I converted many of my CD's to mp3 and I collected many more from various sources which were freely available at the time. As the number of my mp3 files grew, I put them in folders according to their genres and my favorite classifications. I mainly used Windows Media Player to listen to them and I slowly began to dislike wmp because it had massive user interface while I just wanted to listen to music in the background while I was doing other work in the foreground, hopping between folders from time to time. It was the time I was beginning to learn AutoIt and I thought I should make my own player with AutoIt. Coming from a sales career with no experience in programming, it was not an easy task. Somehow, after about 2 years of learning and trying, I had my own audio player which worked with only hotkeys without any graphical interface. I gave it to some of my friends who were not as computer-savvy as I. They liked it but definitely wanted something to clcik with mouse. So I came up with very rude gui which took a form similar to what it is now.
      The attached source files include one au3 file, one icon file and 14 jpg files. The jpg files are used for drawing a graphical player and are fileinstalled in @DocumentsCommonDir folder. This player uses WMPlayer.OCX as its engine and supports all audio file formats supported by wmp and additional codecs installed. I would like to thank @Bilgus for kind answers to my questions and would appreciate it if anyone could review the code and give me any suggestion. This player works for me, but I don't know whether the code is presentable as an example. I am posting this here with a hope to learn much from AutoIt community.
      PS: 1. An error (Variable used before declaration) was reported and corrected - 02:00 hours GMT,  March 14, 2019
            2. An error in tray menu was corrected -10:00 hours GMT, March14, 2019
            3. AutoIt3Wrapper_Au3Check_Parameters definition was added at the top of the code and all ensuing errors were corrected. - 00:10 hours GMT, March 16 2019
            4. Some features were added. - 10:30 hours GMT, March 18, 2019
                a. Jumping to new play-back position in a file
                b. Support for a manually made playlist
                c. Ctrl+Alt+h hotkey to trigger a help message box
            5. The minimum resizing width of playlist window was set at 450. - 01:10 hours GMT, March 23, 2019
            6. Problems associated with actions taken while in 'paused' status was addressed. - 07:40 GMT, April 12, 2019
            7. An error was found and corrected in restoring previous play-back environment when the mode was 'Shuffled.' - 11:00 GMT, April 17, 2019


      Please see Downloads section of this forum for source code files.
       
    • By argumentum
      Today I decided to fix my problem of yelling on my headset's mic. to the point of ... coding a solution 

      As I change the headset, the mic. don't change ( and I forget to do it manually ), so I searched the form for code and came up with the solution to my need.
      #include <Debug.au3> ; for _DebugArrayDisplay() #include "SetMicForPlayback.bulk.au3" ;~ Global $g_aEnumerateAudioDevices = _EnumerateAudioDevices() ;~ Global $g_aEnumerateAudioDevicesWas = $g_aEnumerateAudioDevices ;~ _DebugArrayDisplay($g_aEnumerateAudioDevicesWas, "$g_aEnumerateAudioDevicesWas") ;~ Row |Col 0 |Col 1 |Col 2 |Col 3 |Col 4 ;~ Row 0 |Playback |{34d90035-0679-4b97-b868-ddba418b989b} |{0.0.0.00000000}.{34d90035-0679-4b97-b868-ddba418b989b}|Speakers (High Definition Audio Device) |1 ;~ Row 1 |Playback |{43d508ee-19c5-4513-bd52-e1b7ba57ee82} |{0.0.0.00000000}.{43d508ee-19c5-4513-bd52-e1b7ba57ee82}|Headset Earphone (2- Arctis Pro Wireless Chat) |0 ;~ Row 2 |Playback |{a6f69bc4-f708-4a0f-bf58-995fe9d5d221} |{0.0.0.00000000}.{a6f69bc4-f708-4a0f-bf58-995fe9d5d221}|Headset Earphone (Corsair VOID Wireless Gaming Dongle) |0 ;~ Row 3 |Microphone |{a025c7e9-3655-474f-9643-8f05f1e4d591} |{0.0.1.00000000}.{a025c7e9-3655-474f-9643-8f05f1e4d591}|Headset Microphone (2- Arctis Pro Wireless Chat) |0 ;~ Row 4 |Microphone |{f9a630d2-44e9-4db5-b115-9fe7503a2ec7} |{0.0.1.00000000}.{f9a630d2-44e9-4db5-b115-9fe7503a2ec7}|Headset Microphone (Corsair VOID Wireless Gaming Dongle) |1 ;~ _SwitchToDevice($g_aEnumerateAudioDevices[4][2]) ;~ + [1]"OnDefaultDeviceChanged", [2]"0", [3]"1", [4]"{0.0.0.00000000}.{43d508ee-19c5-4513-bd52-e1b7ba57ee82}" ;~ + [1]"OnDefaultDeviceChanged", [2]"0", [3]"1", [4]"{0.0.0.00000000}.{34d90035-0679-4b97-b868-ddba418b989b}" main() Func main() If WinExists(StringTrimRight(@ScriptName, 4) & "'s hidden window") Then Exit 0 AutoItWinSetTitle(StringTrimRight(@ScriptName, 4) & "'s hidden window") Local $n, $a, $s, $b, $i While Sleep(50) If $g_aAudioSwitched[0] And TimerDiff($g_aAudioSwitched[0]) > 500 Then ConsoleWrite('+ [1]"' & $g_aAudioSwitched[1] & '", [2]"' & $g_aAudioSwitched[2] & '", [3]"' & $g_aAudioSwitched[3] & '", [4]"' & $g_aAudioSwitched[4] & '"' & @CRLF) Switch $g_aAudioSwitched[1] Case "OnDefaultDeviceChanged" $s = "" $a = _EnumerateAudioDevices() For $n = 0 To UBound($a) - 1 If $a[$n][2] = $g_aAudioSwitched[4] Then $b = StringSplit($a[$n][3], "()", 0) If UBound($b) > 2 Then $s = $b[2] ConsoleWrite($s & @CRLF) ExitLoop EndIf Next If $s = "" Then ConsoleWrite(@TAB & $s & ' = not found ?, just 1 device ?, remote audio ?' & @CRLF) Else $i = 5 For $n = 0 To UBound($a) - 1 If $a[$n][0] = "Microphone" Then If StringInStr($a[$n][3], $s) Then ; ObjCreateInterface: "Warning: This feature is experimental." $i = ShellExecuteWait(@ScriptFullPath, "/ErrorStdOut " & $a[$n][2], @ScriptDir) Switch $i Case 3 ConsoleWrite(@TAB & $s & ": apply = True" & @CRLF) Case 4 ConsoleWrite(@TAB & $s & ": apply = False" & @CRLF) Case 1 ConsoleWrite(@TAB & $s & ": apply = Crashed" & @CRLF) Case Else ConsoleWrite(@TAB & $s & ": no clue !" & @CRLF) EndSwitch ExitLoop EndIf Else ContinueLoop EndIf Next EndIf If $i = 5 Then ConsoleWrite(@TAB & $s & ' = ..have to code a "default mic" if none associated. ( you do it, I don''t have one. )' & @CRLF) ;~ AdlibRegister("did_it_work") ; ...to have some feedback while in development, but the "Sound"("Recording" tab), shows the change on the fly. Case Else ConsoleWrite("! no code written for this event" & @CRLF) EndSwitch $g_aAudioSwitched[0] = 0 $g_aAudioSwitched[1] = "" EndIf WEnd EndFunc ;==>main Func did_it_work() AdlibUnRegister("did_it_work") Local $a = _EnumerateAudioDevices() _DebugArrayDisplay($a, "_EnumerateAudioDevices()") EndFunc ;==>did_it_work  
      SetMicForPlayback.bulk.au3 The "bulk" file has the real code, ( not mine, references are in the code )
      SetMicForPlayback.au3 this is the "main()" ( the code you can read above ).
      Works for me on Win10 v???.???.?? ( I'm not good with updates ).
      Hope it helps the next guy playing TF2 as an engineer, finding a headset close to you, to tell your team color to use the teleport that goes to the enemy base to get the intel., no one listens, you get aggravated, #%#$#@$ ....  

       
      PS: ..the above code misbehaves a lot and is left for the adventurous.
      Use the current code in the downloads section for a functional script.
×
×
  • Create New...