0

I am building a little game on website for english learner using PHP and mySQL, my table pronunciation in database will look like this

word_id | spelling | sound

1         school     school.wma

when the sound school.wma is played, users need to type "school" correctly in the textbox, so how to play a sound file

Saty
  • 22,443
  • 7
  • 33
  • 51
user2986673
  • 161
  • 11
  • http://stackoverflow.com/questions/23260092/how-can-i-play-wmv-video-in-html-player – DrLazer Sep 16 '15 at 09:22
  • For starters, that "school.wma" is just the *file name*, right? Or is the actual binary data stored in the database somewhere? – deceze Sep 16 '15 at 09:29
  • @deceze its a wma file name "school" that I will upload it to my own mysql database – user2986673 Sep 16 '15 at 09:34
  • Why would you store a sound file in a database? Try just storing the files data (eg name, location, etc) and use that to locate the file on the disk, then load that into PHP and change headers to reflect that. Then call the PHP file from your HTML. – Pazuzu156 Sep 16 '15 at 13:52
  • @KalebKlein yeah how foolish of me, i just figured out a while ago. Thank you for your answer – user2986673 Sep 16 '15 at 15:17
  • MySQL gives you the option to store blob data, but it can become conversion and can cause huge server load making the query for the data. It's best to store meta data then use that to locate and load the file. Then it can easily be done asynchronously. – Pazuzu156 Sep 16 '15 at 15:25
  • @KalebKlein yeah true, I will only store name, id and the path to the stored place on server in MySQL. You can post your answer and I will mark as a thank you in – user2986673 Sep 16 '15 at 16:41

1 Answers1

0

MySQL gives you the option to store blob data, but it can become cumbersome and can cause huge server load making the query for the data. It's best to store meta data then use that to locate and load the file. Then it can easily be done asynchronously.

Pazuzu156
  • 679
  • 6
  • 13