Hi,
I want to create Arabic to English dictionary with having pronunciation feature for the English words. How it is possible to implement using PHP and MySQL?
Thank you,
Hi,
I want to create Arabic to English dictionary with having pronunciation feature for the English words. How it is possible to implement using PHP and MySQL?
Thank you,
Building on 's question and the direction from and , here are practical options and implementation notes that work well today.
Client-side (fast, no server TTS): use the browser SpeechSynthesis API so the browser speaks the English text directly. Voice availability varies by platform, so detect supported voices and fall back to a server-side audio file when needed.
const u = new SpeechSynthesisUtterance("water");
u.lang = "en-US";
speechSynthesis.speak(u); Server-side (high-quality, consistent): generate audio with a TTS provider (AWS Polly, Azure, IBM) or a local engine, then cache the resulting files. Cache key should be a stable hash of the normalized phrase and language tag. Serve cached files from a static path or CDN to avoid repeated TTS calls.
$phrase = "water";
$key = hash('sha1', $phrase . 'en');
$path = __DIR__ . "/cache/{$key}.mp3";
if (!file_exists($path)) {
// call provider API, save to $path
}
echo "<audio src=\"/cache/{$key}.mp3\" controls preload=\"none\"></audio>"; DB + text handling: store words in utf8mb4 and keep a normalized, diacritic-stripped key for searching/matching. Consider storing phonetic transcriptions (ARPABET/IPA) for display or to feed into TTS rules. The CMU Pronouncing Dictionary is a good source for English pronunciations (CMUDict on GitHub). For MySQL unicode setup see the utf8mb4 guide (MySQL docs).
Practical cautions: watch browser autoplay restrictions (user interaction may be required), set correct MIME/CORS headers for audio files, compress/cache aggressively, and verify TTS provider licensing if audio will be distributed or re-used. For a low-effort start, use SpeechSynthesis; migrate to server-side TTS plus caching as quality or consistency requirements grow.
Jump to Post— cereal 1,524On the administration side you need a form to create an instance for each word associated with the English translation and an audio file that can be mp3, wav or ogg, depends on you. Something like an email an his attachments.
Here I would use two tables for the …
On the administration side you need a form to create an instance for each word associated with the English translation and an audio file that can be mp3, wav or ogg, depends on you. Something like an email an his attachments.
Here I would use two tables for the words, one for the Arabic and one for the English ones. Then a third table where you register only the id from the two previous tables, will connect the words, because you can have one-to-many correlations: "water" or "bread" have many terms in Arabic. For example:
mysql> select id,word from arabic_dict; select id,word from english_dict;
+----+--------+
| id | word |
+----+--------+
| 1 | بحر |
| 2 | ماء |
+----+--------+
2 rows in set (0.00 sec)
+----+-------+
| id | word |
+----+-------+
| 1 | water |
+----+-------+
1 row in set (0.00 sec)
mysql> select * from ArEn;
+-----------+------------+
| arabic_id | english_id |
+-----------+------------+
| 1 | 1 |
| 2 | 1 |
+-----------+------------+
2 rows in set (0.00 sec) On the user side you need a simple interface to get all the data associated with a word. You have a lot to do, good luck! :)
are you after sound files or written phonetics? Google Translate has a feature for pronunciation. I wonder if you can use the API to use it?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.