/However/, if all you're trying to do is do a 1-of-4 identification it would be easier if you assumed that one end of your speaker was grounded, at which point you could have two sense wires which were either grounded or left floating in a binary pattern. That would take 2x GPIO pins set to input with pullup resistors, leaving your I2C available for other use.
yes my first tought was to use a binary system, but because i need to identify 10 differents speaker, it will take 6 wire (2 for audio, 4 for binary) so its a little too mutch. that why i tough about using resistor, but i was thinking that i ca mesure a resistor directly with my "raspberry pi 3b+" and its not the case..
the answer from kupferstecher is very interesting, it dosent need a lot of part, but my coding ability is not very good on lazarus, and i will probably not be able to code that on lazarus
so i'm actually looking on internet to see if i can found exemple code in lazarus to use the MCP3208 or MCP3008 ( in the answer from ojz0r) , but i have not found any exemple until now..
in fact, i have no problem to buy anything that can do what i want, and with the schematic i can build almost anything in electronic, but my problem is that i am completely beginner in lazarus, the biggest problem i have is how to interface lazarus with the electronic device..