Recent

Author Topic: [SOLVED] There must be a better way of playing MP3s  (Read 2233 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Re: There must be a better way of playing MP3s
« Reply #15 on: October 10, 2019, 08:51:31 pm »
It will not be possible to play mp3 "out of the box". A small extension is using BASS. You need the bass.dll from https://www.un4seen.com/, free for non-commercial projects, cross-platform. I am attaching a small demo prepared for playing mp3, wav, ogg and flac files (I don't know, BASS maybe can handle more formats, I only checked the mentioned ones). Your code requires only a few lines (my Sound* routines). The sample comes with the bass.dll for 32 bit windows. Note that you must replace it by the 64-bit version if you want to compile the demo for 64 bit, otherwise the demo will abort immediately.

Okay WP, I got this working.

It seems all I need is a Pause function.
I tried SoundPause(FChannel, FileNameEdit1.FileName);
But get error "identifer not found"

Is there a page docs somewhere so I can paw over it??
I don't see one on their site.

UPDATE:
Got this to work... but stops the playback and not pause it. So, when you click play again it starts over.

Code: Pascal  [Select][+][-]
  1. BASS_ChannelPause(FChannel);

Thanks
« Last Edit: October 10, 2019, 09:12:48 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Re: There must be a better way of playing MP3s
« Reply #16 on: October 10, 2019, 08:54:50 pm »
Well the other option is installing the huge library, but you don't like that too.  :)

Try UOS package.
https://wiki.freepascal.org/uos

I downloaded this and only the samples without fpGUI works.
I can't get aggPas installed for fpgui, gives me errors.. plus it is really old.

But, the UOS may work if I can't get any further with BASS.

It may be big, but the WMP active X is just to buggy, Crashes all the time. I did research and WMP crash is a well known issue.
Don't want to use wmp.dll
« Last Edit: October 11, 2019, 12:27:47 am by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

winni

  • Hero Member
  • *****
  • Posts: 1611
Re: There must be a better way of playing MP3s
« Reply #17 on: October 10, 2019, 09:17:09 pm »
Hi!

Pause in Bass is very simple. Just
Code: Pascal  [Select][+][-]
  1.  
  2. BASS_ChannelPause(Stream);

And start it again with

Code: Pascal  [Select][+][-]
  1. BASS_ChannelPlay(Stream, False);

All the routines are documented in the bass.chm in the package.

Winni



pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Re: There must be a better way of playing MP3s
« Reply #18 on: October 10, 2019, 09:57:44 pm »
Hi!

Pause in Bass is very simple. Just
Code: Pascal  [Select][+][-]
  1.  
  2. BASS_ChannelPause(Stream);

And start it again with

Code: Pascal  [Select][+][-]
  1. BASS_ChannelPlay(Stream, False);

All the routines are documented in the bass.chm in the package.

Winni


Perfect... I was close.
I had the play correct.

However, I had for my resume button play, True instead of false

This will work for now.

I did find the docs and I am in the process of converting the delphi examples to LAZ so I can see what BASS does.


THANKS
« Last Edit: October 10, 2019, 10:12:20 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1233
    • Pixelink Software
Re: There must be a better way of playing MP3s
« Reply #19 on: October 12, 2019, 10:36:19 pm »
Well, I was able to get the BASS system working
Here is a screenshot of the app.

THANKS FOR EVERYONES HELP!!!
Can't Type - Forgetful - Had Stroke = Forgive this old man!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

alaa123456789

  • Jr. Member
  • **
  • Posts: 80
Re: There must be a better way of playing MP3s
« Reply #20 on: July 03, 2020, 05:49:38 pm »
Well, I was able to get the BASS system working
Here is a screenshot of the app.

THANKS FOR EVERYONES HELP!!!

could you please share the code

thanks

alaa123456789

  • Jr. Member
  • **
  • Posts: 80
Re: [SOLVED] There must be a better way of playing MP3s
« Reply #21 on: July 06, 2020, 06:56:51 pm »
hey guys

you could have this advance application from this link

https://youtu.be/85kCaxS_Kig

thanks

 

TinyPortal © 2005-2018