DeMp3 Lib

Developed or developing a new product in PureBasic? Tell the world about it.
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

DeMp3 Lib

Post by Baldrick »

Hi all,

I have made a very simple little Lib for easy { lazy } control of Mp3 files.
It will load, play, stop, pause, etc these files and offers ability to return time string values as millisecond, hh:mm:ss or hh:mm:ss:ms depending on option used. It also will give return values for volume, balance and speed using mp3 files. Return values for most commands use direct mci returns so MCIERR can be used for error handling.
Included is Help file and full source.

Click to Download until release on PureArea

Hope some of you may find this useful.

Regards,
Baldrick
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Have to check this out.

Thanks for sharing it.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

will you release source?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post by Baldrick »

blueznl wrote:
will you release source?
Source is included with the download.
My coding may be far from being the best blueznl as I am at best just a bit of a novice / hobbyist, but it is there for you to do with as you please, even if it is only as a bit of a reference for you. :)
My purpose in writing this Lib was actually more as a practice thing. Mp3 control just seemed like a nice little project for myself.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

hey no prob, i'm probably more of an amateur than most people in here, i just have very strong views on things :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Gansta93
Enthusiast
Enthusiast
Posts: 238
Joined: Wed Oct 20, 2004 7:16 pm
Location: The Village
Contact:

Post by Gansta93 »

If sources are included, why not publish this on PBOSL?
Be seeing you! :-)

Gansta93
If you speak french, you can visite Le Monde de Gansta93 (Gansta93's World)
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post by Baldrick »

@Gansta93,
I see no problem with that if the ppl here think it is worthwhile for inclusion of such a simple Lib. I would like to make sure everything is nice & stable & bug free before I do though.
I have found 1 small error in my help documentation which I will fix very shortly.
Documentation reads as : Result=DeMp3Stop(TrackNum)
Options:
0=stop and return to start of music file
1=stop and remain at current position in music file

Should read as : Result=DeMp3Stop(TrackNum,Option)
Options:
0=stop and return to start of music file
1=stop and remain at current position in music file
So far only very minor.. :)
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

Thanks for the lib, works great! In the chm example there are a couple of "DeMusic..." that need replacing eith "DeMp3...".
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post by Baldrick »

Thanks dmoc,
Fixed. only found 1 instance "DeMp3Pause", so getting close now I think
Btw, DeMusic was my original name for this lib, but I changed it to avoid confusion with format support..
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post by Baldrick »

Sitting around last night I decided to see how this lib would react to some video file formats. The results I got were better than I had expected in that with the formats I tried, not only did I get audio with volume, balance, etc control, but also the mci actually opened a default window for me detached to the playing window but fully synch'd with it. { Video was not at all what I had intended for this lib btw, hence the reason for not specifying hwnd in any parameters which I will now probably do in a later version after PB4 comes out seeing as that should be fairly soon. } Speed was about the only command ignored by the video as is.

For those of you who have d/l'd this Lib, change the file requester in the example file to select " wmv,avi,mpeg, asf. to test as below.

Code: Select all

FileT1$=OpenFileRequester("Choose Track 1 song to play","","Mp3|*.mp3|Wav|*.wav|Video|*.asf;*.wmv;*.mpeg;*.mpg",2)
I have also updated help file now to fix a couple of small errors in it & also now reflects my test results with video formats if anybody wants to d/l again to update. { no actual changes within the Lib its self though }
Post Reply