Solved

Creating mp3 database

Posted on 2004-05-02
7
281 Views
Last Modified: 2012-06-21
Dear Experts,

I am currently trying to build an mp3 database on my postgresql DB system under Linux box. Please can anyone tell me how to proceed? I am a bit confuse how to store files (mp3) into the database because normally I just store an information such as names, addresses. I need to know where to on my disk/directory these mp3 files should be stored as well as command/query to initially store them.

Thank you for your help.
0
Comment
Question by:mafendee
  • 4
  • 2
7 Comments
 
LVL 2

Expert Comment

by:ljian
ID: 10972152
The simplest way to do it is to store only  the name of the mp3 file along with full path in a VARCHAR field.
for ex: FILE= '/home/user/mp3/Beatles-Let it be.mp3'

You can then feed this field value to a command line player (mp123)

To store them in the database is very dificult ... should be treated as LOBs (Large Object Bynary)
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10977959
You will be inviting troubles by storing them in a database. Store them in the file system and protect them with file-system permissions. For the structure, my recommendation would be:

Table Artist_Band
=============
ID - Running serial
Artist_Band - The name of the Artist or the Band
Type - Artist or Band


Table Albums
=============
ID - Running serial
Album - Name of the album


Table Titles
=============
ID - Running serial
ID_Artist_Band - The ID of the Artist or the Band
ID_Album - The ID of the Album
Path - Path on the file system
Year - Year (Optional)
Genre - Genre (Optional)
Bit_Rate - Bit-rate (Optional)
Rating - Rating (Optional)
URL - URL (Optional)
... ... ...
... ... ...
Any other title specific info.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10978001
You will be inviting troubles by storing them in a database. Store them in the file system and protect them with file-system permissions. For the structure, my recommendation would be:

Table Artist_Band
=============
ID - Running serial
Artist_Band - The name of the Artist or the Band
Type - Artist or Band


Table Albums
=============
ID - Running serial
Album - Name of the album


Table Titles
=============
ID - Running serial
ID_Artist_Band - The ID of the Artist or the Band
ID_Album - The ID of the Album
Path - Path on the file system
Year - Year (Optional)
Genre - Genre (Optional)
Bit_Rate - Bit-rate (Optional)
Rating - Rating (Optional)
URL - URL (Optional)
... ... ...
... ... ...
Any other title specific info.

I reccomend store the entire spectrum of info as per MP3 Tag V2 spec.


0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:mafendee
ID: 10986060
The thing is, if I just store the mp3 files by name, how can I later query and load it into the player or other program for further use? If I am right, in postgresql I could also use TEXT field instead of VARCHAR? Do you see any different between this two datatype?
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 125 total points
ID: 10986266
If you store the filename, you'd be happier and would be spending much less time coding. You just have to construct and pass the full file name to the media player you use. But if you store the MP3 file in a BLOG field, God help you. I don't know of any media player capable of playing directly from a database BLOG field. YOu will have to extarct the content and generate a temporary file anyway. Scary it sonuds tome, to say the least.

>> Do you see any different between this two datatype?
That depends on the implementation. Typically TEXT type is a large CHAR type which allows you to store large amounts of text. But it is of fixed width. You might endup wasting a lot of space in your DB. A VARCHAR is a flexible length text filed. It occupies ONLY enough required amount of storage space.


~ Ranjeet Rain


0
 

Author Comment

by:mafendee
ID: 11015770
Thank you for the answer. It was very quick and useful!
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11017179
Glad to help!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
constraint check 2 43
Generate Scripts of Schema/Data with "WHERE" clause 6 64
Simple SQL query from two tables 13 55
VMWare environment audit 8 31
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 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