Ask Your Question
0

store mp3 in base

asked 2017-03-31 07:07:41 +0200

gandalf1000 gravatar image

I want to create a table with these fields: word varchar(30) definition varchar(60) sound mp3 file image gif or png file

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-03-31 16:51:31 +0200

updated 2017-03-31 16:54:35 +0200

Ciao, I think you can store a link to mp3 files in a database field and a link to gif/png files in another database field.

If you export your database, you must export also mp3/gif/png files.

If my answer helped you, vote it with ✔ (here on the left)

edit flag offensive delete link more
0

answered 2017-03-31 20:07:14 +0200

Ratslinger gravatar image

I'm not sure to what end you would want to store mp3 in a database since you can create a reference in any document. My only thought is to be able to play the mp3 you have on file. If so, read on.

To actually store an image or mp3 file in an embedded database is not advisable. There are problems using the longvariable field when stored this way and will cause DB corruption in less than 10 records. This is usually not a problem with split or external DB's. The best way to create is (as @charlie.it mentions) through links to the images and/or mp3's.

To actually play the mp3 from within Base, you need a macro. The macro is started from a pushbutton and plays the linked mp3 file. A sample is attached to demonstrate this. There are no records in the table since these are external to the .obd and rely on actual location of the image or mp3. This has been tested and provides minimal functionality (start & stop mp3) There are other functions which can be added through more code. Here are some references for the how each element is generated:

Linking an Image - click here

Play mp3 macro - click here

Other functions for player - click here

Sample Base file: ImageAndMP3Play.odb

edit flag offensive delete link more

Comments

BTW - only tested this using Linux Mint 18 & LO v5.3.1.2

Ratslinger gravatar imageRatslinger ( 2017-03-31 20:24:02 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-03-31 07:07:41 +0200

Seen: 63 times

Last updated: Mar 31 '17