Solved

which data type for audio in mysql

Posted on 2013-12-20
4
1,334 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 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39733228
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 83

Expert Comment

by:Dave Baldwin
ID: 39733229
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
ID: 39733266
that is the best alternative thanks for pointing it out...
it is late and i am not thinking straight
0
 
LVL 83

Expert Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

911 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

18 Experts available now in Live!

Get 1:1 Help Now