Menu

I use the overwrite config-file method for changing profiles. Is this an OK method?

2026-08-20
7 days ago
  • Lasse Gustafsson

    Hello all!
    First I must say that I love Equalizer APO.
    I changed the tweeters in a pair of second hand speakers I bought, but I didn't do my homework before the swap. New tweeters have higher sensitivity than the old ones, so I really need to either add resistors in the speakers or use an equalizer.

    Anyway, I don't need eq when using my headphones so I have 2 profiles at the moment.
    What is the prefered way to switch profiles?
    Currently I have a simple config that more or less just include "Speakers" and "Phones".
    From those 2 text files is where the magic starts. ..
    I change between profiles with .bat files that I trigger with a VBScript so all happens in the backround.
    The active config in EAPO folder is overwritten at every profile change.
    I never change on the fly. I even stop the audio stream through a virtual Audio Repeater.
    But I have tried on the fly with no problems, but better safe than sorry.

    I now also have a .bat for just checking what profile is active and that way I don't overwrite config more than I have to.

    Any thoughts about this method? Could it lead to problems down the way?

    Ps No I don't want to add another GUI. :D

     
  • Peter Verbeek

    Peter Verbeek - 2026-08-20

    For these kind of purposes one uses the power switching capabilities of Peace Equalizer but as you want to use your VBScript I'm guessing your method works fine although I do the following probably safer method:

    1. Create a temp file with the commands you want to be executed, in your case you have those already.
    2. Lock the config.txt so the Equalizer APO's engine can't accessed it.
    3. Copy the temp file to config.txt.
    4. Remove the lock.
      This can be done while playing any audio, making your VBScript dynamical.

    However, when having 2 distinct audio devices in Windows things become much easier. No switching is needed as it's all about having a device selection command before the commands you want to be executed on that device, so config.txt in your case and many cases looks like this:

    1. Device selection command
    2. EQ device commands
    3. Another device selection command
    4. EQ device commands
      The VBScript or the Configuration Editor isn't needed any longer when this is set up.

    However, when having 1 device which is for the speakers and headphones things are a bit more complicated in the Configuration Editor as you have noticed (hence your VBScript of course). For other readers of this post (and not wanting to use Peace), it's mainly about making 2 separate .txt files in which the first line is the device selection command. Then in config.txt add 2 include commands referring to these 2 include files, so like this:

    include: myspeakersEQ.txt
    include: myheadphonesEQ.txt
    

    The switching is done by clicking the on/off switch at the left of these include commands. 2 clicks: 1 to switch off one file, 1 to switch on the other.

     
  • Lasse Gustafsson

    Thanks!
    It's the first time I hear/read about locking the config file. How is that done?

     
    • Peter Verbeek

      Peter Verbeek - 2026-08-20

      As I'm using AutoIt as programming languages I do basically the below where the file is peace.txt is in $ConfigFile and config.txt has include: peace.txt.

      Local $FileHandle, $TimerHandle = TimerInit()
      
      Do  ; check if Equalizer APO is reading
              $FileHandle = FileOpen(FileAddPath($ConfigFile,$ConfigPath),$FO_APPEND)
      Until $FileHandle <> -1
      WriteToLog("Lock on config file in " & TimerDiff($TimerHandle) & " milliseconds")
      ; copy file to activate
      If FileCopy($CommandsTempFile,FileAddPath($CommandsFile,$ConfigPath),$FC_OVERWRITE) = 1 Then
              WriteToLog("Temporary config file copied successfully")
      Else
              WriteToLog("Temporary config file couldn't be copied")
      EndIf
      FileClose($FileHandle)
      If FileDelete($CommandsTempFile) = 1 Then
              WriteToLog("Temporary config file deleted successfully")
      Else
              WriteToLog("Temporary config file couldn't be deleted")
      EndIf
      

      Ignore the trace logging statements.
      I'm sure there's a better method in other programming languages. But the main trick is to use an include command, in my case for peace.txt and copying a commands file to this peace.txt.

       
  • Lasse Gustafsson

    Wow, that's way over my head. :D

    I've been doing some thinking... if I plug my phones directly into my pc, I only need to change default output device.
    I stream with Deezer and unfortunately I can't set output device in there.
    EAPO isn't installed for the PC soundcard only my external DAC.
    This way I can leave EAPO alone in "Speaker Mode".

    My new .bat files will instead be to set default output device.

     
    • Peter Verbeek

      Peter Verbeek - 2026-08-20

      Good thinking.

       
  • Lasse Gustafsson

    Thanks for your support!
    :)

     
    • Peter Verbeek

      Peter Verbeek - 2026-08-21

      No problem, Lasse.

       
  • Lasse Gustafsson

    Just a final note...

    I want the possibility to add equalization later on for the headphones so I added the "Select Device" feature to my config. After EAPO installation for the internal soundcard.
    Works like a charm. :)

     
    • Peter Verbeek

      Peter Verbeek - 7 days ago

      Yep, that's how's done 😃

       

Log in to post a comment.