Page 2 of 4

Re: Core Audio Plugin

Posted: Sun Sep 15, 2019 9:25 am
by kgschlosser
well change the language you have set in EG to English :shock:

I'm playing. I will fix it.

Re: Core Audio Plugin

Posted: Wed Sep 18, 2019 9:57 pm
by z3us
I´m afraid it still doesn´t work
Error starting plugin: Core Audio
Traceback (most recent call last) (0.5.0-rc6):
File "C:\Program Files (x86)\EventGhost\eg\Classes\PluginInstanceInfo.py", line 196, in Start
self.instance.__start__(*self.args)
File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 759, in __start__
self.callbacks = Callbacks(self)
File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 265, in __init__
self.__map_device(device)
File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 282, in __map_device
endpoint.data_flow
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 4: ordinal not in range(128)

Re: Core Audio Plugin

Posted: Thu Sep 19, 2019 4:12 am
by kgschlosser
I didn't say that I had fixed it. I said I will fix it.. I have not gotten to it yet. I did come across another bug so I am going to fix that one at the same time.

Re: Core Audio Plugin

Posted: Thu Sep 19, 2019 7:32 pm
by z3us
kgschlosser wrote:
Thu Sep 19, 2019 4:12 am
I didn't say that I had fixed it. I said I will fix it.. I have not gotten to it yet. I did come across another bug so I am going to fix that one at the same time.
Sorry. I thought u said that changing the language of EG would fix it

Re: Core Audio Plugin

Posted: Fri Sep 20, 2019 6:08 am
by kgschlosser
you need to change the local to US. which would be setting your Windows language and region to United States... This is something I overlooked when I made the plugin I had forgotten that I am dealing with information from Windows and it can return unicode data. unicode data is striong data outside the 32-127 decimal value for each byte (letter) ascii codes essentially. when dealing with other languages that have characters that do not fall into that range unicode is used to handle that extended information. where in the English language all human readable characters fall between 32 and 127 decimal value. and unicode allocates additional bytes to extend the character set.

better explanation is this..

a number from 0 to 255 when stored on a computer takes up 1 byte in size or 8 bits... so there is a mapping of letters to a number value. so one letter in the English language will also take up one byte of data...
the letter A when stored is the number 65 (hex 0x41)
and the letter ń with acute is the number 324 (hex 0x144) which is outside of the ascii range and is also a larger numeric value then one byte can hold. so 2 bytes need to be allocated for this data. so when you store a string or a bunch of letter together when the string is viewed as non unicode each letter is a single byte of data. and when manipulating the string at all it is done a single byte at a time. when dealing with unicode that has multiple bytes for a single character i cannot use the normal container for a string because it is not designed to know how many bytes to return for a unicode character.

It's a real pain in the ass actually.... I am going to screw round with it now..

Re: Core Audio Plugin

Posted: Fri Sep 20, 2019 11:51 am
by z3us
Thank you for your work

Re: Core Audio Plugin

Posted: Wed Oct 23, 2019 6:44 pm
by kgschlosser
OK I have been dinking around with the unicode problem. I have to do a little more bug testing but I should have it finished up in the next few days. I had quite a bit to modify. I didn't realize how much information I obtained from Windows could be unicode encoded.

Re: Core Audio Plugin

Posted: Wed Nov 06, 2019 1:16 pm
by dan Edens
omg and just like that the long war with "device attached" is over lol.
I finally have a reliable way to tell if my computer is docked, in the field, or at home.
yuuuussssssss
+1 Internets

Re: Core Audio Plugin

Posted: Wed Nov 06, 2019 1:17 pm
by dan Edens
It can even tell which port my headset is plugged into... bruh
thhhaaannnkkkkk yyooouuuuuuuuuuu

Re: Core Audio Plugin

Posted: Wed Nov 06, 2019 1:34 pm
by dan Edens
Was getting constant errors with "new_volume" not being set. Added this at line 468 in %PROGRAMDATA%\EventGhost\plugins\CoreAudio\__init__.py and it made it stop. If my volume randomly freaks out I'll update. lol

Code: Select all

       
        try:
            new_volume
        except AttributeError:
            new_volume = old_vol + 1
        except UnboundLocalError:
            new_volume = old_vol + 1
            
            

Re: Core Audio Plugin

Posted: Wed Nov 06, 2019 3:26 pm
by kgschlosser
Yeah I saw that issue I just never got a chance to fix it. I am still screwing about with the unicode issues as well. Working in windows when it's set to a different language is a pain in the ass. so it's hard to bug fix the unicode issue.

Re: Core Audio Plugin

Posted: Wed Nov 06, 2019 3:41 pm
by kgschlosser
the correct fix is this actually

Code: Select all

        if new_vol is not None and old_vol is not None and new_vol > old_vol:
            vol_diff = new_vol - old_vol
        else:
            vol_diff = old_vol

Re: Core Audio Plugin

Posted: Wed Nov 06, 2019 3:48 pm
by kgschlosser
scratch the last comment. there is a larger underlying problem. I am going to release a new version shortly that will have that error and hopefully the unicode problems solved.

Re: Core Audio Plugin

Posted: Thu Nov 07, 2019 5:58 am
by kgschlosser
come and get it.. a new version is available.. see the first post in this thread..

Re: Core Audio Plugin

Posted: Sat Nov 09, 2019 12:30 pm
by z3us
kgschlosser wrote:
Thu Nov 07, 2019 5:58 am
come and get it.. a new version is available.. see the first post in this thread..

Code: Select all

   Error starting plugin: Core Audio
   Traceback (most recent call last) (0.5.0-rc6):
     File "C:\Program Files (x86)\EventGhost\eg\Classes\PluginInstanceInfo.py", line 196, in Start
       self.instance.__start__(*self.args)
     File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 876, in __start__
       self.callbacks = Callbacks(self)
     File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 271, in __init__
       self.__map_device(device)
     File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 290, in __map_device
       _format_endpoint_name(endpoint),
     File "C:\ProgramData\EventGhost\plugins\CoreAudio3\__init__.py", line 161, in _format_endpoint_name
       name = endpoint.name.decode('utf-8')
     File "encodings\utf_8.pyc", line 16, in decode
   UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 10: ordinal not in range(128)
CoreAudio.Realtek High Definition Audio.Altavoces (Realtek High Definition Audio).Default.Render <eg.UserPluginModule.CoreAudio3.pyWinCoreAudio.endpoint.AudioEndpoint object at 0x0B91F2F0>