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
DeMp3 Lib
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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
blueznl wrote:
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.
Source is included with the download.will you release source?
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.
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... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
@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..
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..

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.
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 }
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)