Solved

which data type for audio in mysql

Posted on 2013-12-20
4
1,291 Views
Last Modified: 2013-12-20
what data type do i use in mysql if i want to store audio files in the database????
0
Comment
Question by:selhamwy
  • 3
4 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
 

Author Closing Comment

by:selhamwy
Comment Utility
that is the best alternative thanks for pointing it out...
it is late and i am not thinking straight
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Thanks for the points.  Get some rest, things will work out better.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now