I know it's not strictly what you are looking for, but I had this problem too, and it turned out that I was trying to use the wrong codes and in the wrong way.
I found this resource: https://irdatabase.globalcache.com/irdatabase.htm and it seems solid, at least for my Samsung TV.
To use it, you have to sign up with yahoo/google/facebook (which I found weird.... but the website I found it on, http://www.power7.net/SamsungIR.html says it's fine, and they haven't spammed me yet...) and pick out which device you need. Then, you'll get something that looks like this:
sendir,1:1,1,38226,1,1,170,171,21,65,21,65,21,65,21,22,21,22,21,22,21,22,21,22,21,65,21,65,21,>65,21,22,21,22,21,22,21,22,21,22,21,22,21,65,21,22,21,22,21,22,21,22,21,22,21,22,21,65,21,22,2>1,65,21,65,21,65,21,65,21,65,21,65,21,1783,170,171,21,22,21,4892
Remove the "sendir,1:1,1," and you'll find 38226 as your frequency. Then, the next ",1,1" should also be removed and the rest is what you need to transmit. Like the other answer said, I needed to multiply each number like: * 1000000/frequency;
For example, the first few numbers of the above in my int[] look like this:
int[0] = 4447 //(originally 170)
int[1] = 4473 //(originally 171)
int[2] = 549 //(originally 21)
Good luck, and I hope this helps you!