Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Customer cannot load music

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 21st Jun 2013 03:11
That would be an AMAZING help, TheComet!


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jun 2013 13:16 Edited at: 21st Jun 2013 13:20
Files are attached.

I copied an online example for this to save time from here. It uses only Windows API calls, no 3rd party DLLs such as Bass or FMod. I think that's what DBP does as well.

Simply double-click on the exe file "bin/debug/simple-mp3player.exe". It currently only supports 44100Hz sample rates. It will automatically load the file "music.mp3", which should be located in the same folder as the exe.

There are build instructions in the README.txt file so you can set up the project in your own IDE and edit the source code.

Let me know how it goes!

TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jun 2013 13:30 Edited at: 21st Jun 2013 13:30
Doesn't work for me. I get the following incomprehensible error:

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 21st Jun 2013 15:00
I get the same error pop up :\

In other news, I re-wrote my music player app for him using an OGG file in place of the MP3 and it worked flawlessly.

Strange!


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jun 2013 16:25
Odd... I suppose this is the part where I tell you I hate the Windows API.

Could you try building it yourself and see if that works? The instructions are in the README.txt file, it's pretty straight forward.

Would writing a player using FMod or Bass be at all useful?

It would be very helpful to know what DBP uses to load music.

TheComet


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jun 2013 16:26
Quote: "Strange!"


But beautiful.
MonoCoder
20
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 21st Jun 2013 17:10 Edited at: 21st Jun 2013 20:14
so given the above this is rather moot, but not seen it forwarded for a try yet so: have you tried using Torrey's Enhanced Audio Plugin?




You should, I think, be able to find-replace "music" with "audio" in your code and it'd work just the same. I'm pretty sure it takes a different approach to handling music so it shouldn't hit the same snag native DBP does...


edit: linked to an older version, changed now.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 22nd Jun 2013 11:46
Interesting! Haven't seen that one. Might give it a go. That way, if it works, I don't have to push out 70MB of OGG files through the update system


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 22nd Jun 2013 11:52
@TheComet - Still breaks when I compile it myself


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 22nd Jun 2013 15:18
heh, here's an oddity for you. I put out an OGG tester for everyone to try, and most people can't run it. So we have 99% of people not being able to play OGG and 1% of people not able to play MP3!


Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 22nd Jun 2013 15:29 Edited at: 22nd Jun 2013 15:30
Media player doesn't have OGG support so windows doesn't have it. Install the codecs and they'll be able to play it just fine.

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jun 2013 15:50
VLC or XMPlay are good media players.

TheComet

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 22nd Jun 2013 17:34
Yep. Might have to find a way to include the OGG codec into the game installer...


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 22nd Jun 2013 17:35
Strange, though, that the one customer who can't load MP3s can load OGGs, and all of the customers who CAN load MP3s CAN'T load OGGs.

Oh, what a cruel world lol


Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 22nd Jun 2013 17:52
That's why we love computers! lol

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 24th Jun 2013 14:52
Hmm... It looks like OGG requires a codec to be installed. A bit of a hard thing to orchestrate with 1000 players... Anyone know of a way I can push it through as a DLL that gets added to the game directory or something sneaky like that?


Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 24th Jun 2013 15:46
You are doing a lot of work for one computer. If somebody can't play the game, just give them their money back.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Jun 2013 15:52
Torreys enhanced audio plugin plays oggs.

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 24th Jun 2013 15:52
Heh I can't do that.

a) I love my fans

and b) If it can happen to one person, it can happen to others!


Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Jun 2013 21:25
And, of course,

(c) there's nothing like a good challenge.
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 25th Jun 2013 02:43
A plugin would be the next logical step to investigate, as it might include it's own decoder allowing you to bypass either the MP3 crash or the OGG codec requirement.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Jun 2013 07:02
Indeed, but how to implement it? If there was a plugin that could work just by placing a DLL file in the same folder as the EXE that would be idea, but I don't think it works that way... I have a very specifically set up update distribution system that just adds/removes files to the game directory, so installing new things, like codecs, needs to be done manually by the community.

I'm starting to think that perhaps it would be more pertinent to add an option to run as either OGG or MP3, and letting people change a flag in a config file in the extremely rare case that they can't play MP3s...


Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 25th Jun 2013 07:12
There might be a plugin that decodes either mp3 or OGG on its own without needing dll or codecs. I'm not certain but that's where I'd be looking. Also using a plugin might just magically make the problem go away for the affected user using mp3. It's possible the code might be different enough to not encounter the same bug.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Jun 2013 08:15
Hmm... Possibly. I tried using Torreys enhanced audio plugin but it just crashes for almost every user...


Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Jun 2013 17:23 Edited at: 25th Jun 2013 17:23
Quote: "I tried using Torreys enhanced audio plugin but it just crashes for almost every user..."

I've found it's very picky about the file format/ID3 tags of the MP3's. It would work for some files, but crash with others. Seems the encoder would encode the file in a way which the EAP would crash. I couldn't quite figure out what combination of settings caused the crash so I switched to another audio format. (I think I ended up using Flac files in the end.)

And I believe the BASS player only requires a dll in the applications root folder.

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 26th Jun 2013 15:15
To clarify, the Torrey's plugin was causing crashes whilst playing OGG files.


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Jun 2013 21:57
Here, try this (attached). The test application is in the folder "example_DBP".

I wrote a DLL for dbp which can be loaded at runtime. This one uses SFML to play the music, so there are 3 DLLs in total (you only have to load one of them though).

NOTE: The DLL currently crashes when you either call delete dll or close the application. I'm not sure why. I've included the source files for C++ as per usual, if anyone can tell me why the DLL isn't unloading correctly, I'd be very grateful.

Supported formats:


Example application (DBP source, included in the download):


Please let me know if it's worth working further on this or not. If you see this as a viable option, I will invest some more time into finding the unloading bug.

Also let me know if you have any requests for more features (such as seeking, retrieving music position, etc.)

TheComet

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Jun 2013 15:28
ooooOOOOOOOOOooooooooo

I'll let you know how it goes!


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Jun 2013 15:30
I get the error "The program can't start because OpenAL32.dll is missing from your computer. Try reinstalling the program to fix this problem."


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Jun 2013 15:32
From what I can tell, this is happening when the program tries to load simpleMusic.dll


Daniel wright 2311
User Banned
Posted: 27th Jun 2013 17:36
I do not get it, WHY NOT JUST CONVERT IT TO A .WAV FILE THEN LOAD THAT UP AND JUST USE THAT?

my signature keeps being erased by a mod So this is my new signature.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Jun 2013 17:54
Because of how much memory that uses. Please, I'm not looking for an alternative to how to do my entire music system, I'm looking for a solution to one person out of a thousand's problem. Please stay on topic.


Daniel wright 2311
User Banned
Posted: 27th Jun 2013 18:58
This is the topic, the music will not work for one person, change the one music file to a .wav, how much memory will this lose? for one file? really? not being harsh just asking. if it was me, this is what I would do for this one person.

And how is changing one sound file going to change the whole system? just wondering.

my signature keeps being erased by a mod So this is my new signature.
Daniel wright 2311
User Banned
Posted: 27th Jun 2013 19:04
And just to let you know I tested your example on my pc and it worked just fine, I would say it is his pc.

my signature keeps being erased by a mod So this is my new signature.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Jun 2013 19:31
I think CumQuat needs to edit his first post.

I'm sure he said later that the user had the same problem with any file of that type.

And there's always the risk that another customer might pop up with similar problems so a definitive solution is what is needed - preferably one involving something simple like updating a specific driver or DLL etc.
Daniel wright 2311
User Banned
Posted: 27th Jun 2013 19:36
Quote: "I think CumQuat needs to edit his first post."


I see, well, that sucks, if every file is doing it then it has to do with a driver or a missing dl like you said, this makes more sense.

my signature keeps being erased by a mod So this is my new signature.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Jun 2013 22:25
Quote: "I get the error "The program can't start because OpenAL32.dll is missing from your computer. Try reinstalling the program to fix this problem.""


Fixed, try this download (attached).

TheComet

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Jun 2013 03:37
Daniel, I understand that you're trying to help, but there are two types of coders: those who are willing to use bandaid fixes and those who aren't. I'm the latter. I like to be thorough.

Thanks, TheComet! I'll give it a go and see what's what!


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Jun 2013 03:40
No error this time, but it returns "unable to load dll" :-\


Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 28th Jun 2013 05:29 Edited at: 28th Jun 2013 05:35
Quote: "Daniel, I understand that you're trying to help, but there are two types of coders: those who are willing to use bandaid fixes and those who aren't. I'm the latter. I like to be thorough."

You mentioned this to me also. Everyone prefers a complete and elegant solution. In this case it appears you have a patiently waiting paying customer. So I will not avoid quick fixes if they can get him/her happily along playing the game sooner. Even if the solution is temporary and replaced with a more perfected solution at a later date.

People have perceived this to be a time sensitive issue, that's why you are getting "bandaid solutions".

My assumption here is that actually fixing the problem is ultimately more important then how it is fixed. As long as things remain practical.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Jun 2013 13:21
Unfortauntely, however, I have an automated update system in place, so if I send out an update it needs to go to everyone all at once. So band-aids, while faster, is not neat.


Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 28th Jun 2013 15:15 Edited at: 28th Jun 2013 15:17
If you can't find a solution you'll have a tough choice to make.


I will continue trying to help you.

You could expand your update system to support an exception/exclusion list. A file that contains paths the updater won't update. I'm talking about giving your game really simplistic MOD support.

This way you can give the affected user custom formatted music files, outside of the update system and the updater won't overwrite them. Only the affected user will use the exclusion list pointing to the music folder. The music loader in the game can be written to favor the modified music files if and only if they are present, falling back to the regular files otherwise.

This allows the affected player to use modified files without the updater sending them to everyone or interfering.


TL;DR: Give the game Mod support and make him a music mod.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Jun 2013 15:32
Yeah, I've been thinking it may be best to include a config flag where one can set the game to use OGG or MP3 format.

I'm interested to see what TheComet's software does once it runs, too.


Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 28th Jun 2013 15:57
Quote: "Yeah, I've been thinking it may be best to include a config flag where one can set the game to use OGG or MP3 format."

You can make that part automatic. Some pseudo code:

If file exist( "level_one.ogg" ) = 1
Load music "level_one.ogg"
Else
Load music "level_one.mp3"
Endif

This is code that can be given to everyone and it won't affect them since only the one guy will have "modded" files. So the game takes advantage of the modded music only if it exists.

Quote: "I'm interested to see what TheComet's software does once it runs, too."

Yeah. Seems to be the only hopeful chance at a full solution at this point.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Jun 2013 16:45
That's actually a good way of doing it. I like that.


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Jun 2013 16:45
I'll still keep searching for a global solution in the meantime, though, as you never know when this sort of thing might happen again!


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 28th Jun 2013 18:46
Quote: "I'm interested to see what TheComet's software does once it runs, too."


I'm sorry there are so many problems with the DLL not being compatible... I've never written a DLL for DBPro before, and don't know the ins- and outs yet (because no one seems to know anything about DLLs and DBP anyway).

It would be really helpful to me if we could sit together and just try a few things, to get this problem solved. It works fine on my computer. If you could add me on skype, the process of finding the error would be a lot quicker:


TheComet

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 29th Jun 2013 05:02 Edited at: 29th Jun 2013 05:08
Sure thing, dude! It's probably long overdue anyway! You're even in the credits on Malevolence after all the help you've given!


Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Jun 2013 18:49 Edited at: 29th Jun 2013 18:57
Hi CumQuaT,

Early DarkBASIC used the windows multimedia API to play music like midi and mp3s. I don't know if the latest DBPro has moved beyond that or not. The Winmm is really easy to use, that's why I think it was incorporated into DB.

Anyway, I have some old code that I used long ago to test the lengths of MP3s through the winmm API. It has error reporting. Though it's written for DBC, you may be able to use it in DBPro.

If you run this on the non-functioning machine, it may give you some idea of what's going on - that is if it causes an error. If so, you will know that DBPro most likely is using the winmm to LOAD MUSIC. And if that is the case, you'll have to change the windows settings to be able to run MP3s on that machine. It's not a hard fix. It's a matter of telling the MCI to use the MPEG2 driver or something like that. I can't remember because I haven't trouble shot the MCI in a while.



If all mp3s fail on that persons computer, then there should be an error. However, if it is successful with this code, then the winmm api is capable of playing an mp3 and you can use that directly instead of playing music through LOAD MUSIC.

For your update code, you can run a test through the winmm API. If there is no error, then you direct MP3 play through the MCI. I'm using winmm API and MCI interchangeably but the reality is the MCI is easier to use and the winmm API is low level multimedia access. I'm actually using MCI commands in the example code but it is all part of the winmm API.

Enjoy your day.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 30th Jun 2013 08:30
This is very cool, Latch! Thank you! I'll give it a try!


Login to post a reply

Server time is: 2026-07-06 22:15:59
Your offset time is: 2026-07-06 22:15:59