tl;dr:
I downloaded this file from this site (x64) version and placed it in my retroarch folder.
Long version:
I wanted to use the newest nightly because when i ran the the latest stable, it crashed after es certian time.
The x64 build didn’t work so i used the x32 build.
The problem was that the x32 version hast distorted sound in mame.
I tried EVERYTHING to get the x64 version to run.
Reinstalled all visual c++ distributables etc…
Then i found out about a tool named dependencywalker.
When i first ran it, there wasnt anything marked red on the right side (or i didn’t saw it.
I installed the directx runtime component again as a last try. Still not working…
I started dependencywalker again, an the mentioned dll file was marked as red. That should mean that the ddl file the program uses is x32 instead of x64.
I copied the dll out of my “SysWOW64” folder and put it in the retroarch folder, didn’t work. Same procedure but using the dll out of my “System32” folder. Didn’t work either.
I searched for the file on google and found it on the page mentioned at the top of my post, put it in my retroarch folder and it worked.
I compared the md5 hashes of the dll file i downloaded with the ones in the “System32” and “SysWOW64” folders and they are different.
Everything of Windows 10 by the way.
If this doesn’t work for you, you could try to deinstall everything that hast “visual” in its name and use this dependency package.
Did that before so it could possibly be related and i thought i should mention it.
Hope this helps some those people who encountered the same problem.