which data type for audio in mysql

what data type do i use in mysql if i want to store audio files in the database????
selhamwyAsked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
It would be binary blob http://dev.mysql.com/doc/refman/5.5/en/blob.html .  But it's generally not a good idea.  You usually have to extract media data back to files so the players will know what to do with them.  The usual recommendation is to store the audio files in the file system and the file names and paths in the database.
0
 
Dave BaldwinFixer of ProblemsCommented:
Note that blobs are stored outside the database as files.  So to use a blob for an audio file, you would have to read it from the database, write it to a file with the right extension, and then let the player read the file to play.  That's a lot of disk activity compared to reading the file name and passing it to the player.
0
 
selhamwyAuthor Commented:
that is the best alternative thanks for pointing it out...
it is late and i am not thinking straight
0
 
Dave BaldwinFixer of ProblemsCommented:
Thanks for the points.  Get some rest, things will work out better.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.