Might want to double check the license, but the baseline standard is the CMU Pronunciation dictionary, which is freely downloadable and also ships with many NLP libraries, like NLTK (python).
For out-of-vocabulary words, I've had great success with Sequitur G2P, which is both trainable and under the GPL.
edit: note that CMUDict (and many other speech processing pipelines) represent pronunciation in ARPAbet. I apparently don't have enough points to post more links, but google "FAVE ARPABET" and you'll get a handy cheat sheet.
edit 2, in response to OP's edit:
Converting from arpabet to IPA is deterministic, so again, wikipedia is your friend as long as broad transcription is acceptable (see note below)
Depending on the language, you may not need a pronunciation dictionary. german, japanese and korean are examples of languages that have a deterministic mapping of grapheme to phoneme. english orthography is a hideous mutt of historical accident, so sometimes there's really just no way to tell how a word will be said without just memorizing it. french is horrible, too. i'm not sure about arabic. i'd ask people who do automatic speech recognition in your target language (googling should bring you some researchers' homepages)
"note below": 99.99% of the time, in real-world engineering usage, it is. IPA transcription can get insanely narrow, describing phonetic attributes things like aspiration, specific articulatory gestures, etc that don't "exist" in a speaker's conscious knowledge of their language because they're not phonemic, meaning that they can't be used to signal the difference between words with two different meanings