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.

Author
Message
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 5th Apr 2012 21:39
It seems the AppGameKit won't load a 'wav' file if it is not in the same folder as the exe file...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Apr 2012 22:21
What platform are you seeing this on?

On my Windows platform, AppGameKit has no issue with the .wav files in the media directory.

When tested on an Android, the .wav files are in the assets directory and that works fine as well.

Cheers,
Ancient Lady
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 6th Apr 2012 16:55 Edited at: 6th Apr 2012 16:58
I am using Windows 7 with Tier2
Quote: "On my Windows platform, AppGameKit has no issue with the .wav files in the media directory."

Is there a special directory named 'media' where I have to place the .wav files?

This is my case:
Path of the solution of the MS Visual 2010 Express:
"C:\Users\George\Documents\Programming\AppGameKit\GUI"

Path of the .exe file:
"C:\Users\George\Documents\Programming\AppGameKit\GUI\Debug"

Path of the .wav files:
"C:\Users\George\Documents\Programming\AppGameKit\Resources\Sounds"

Having this structure I code as follows:

but I cannot hear any sound when running the program. If I place the .wav file in the debug directory everything works OK
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Apr 2012 17:05
On Windows machines, the default location for images and sound is a directory named 'media' directly below the directory that the executable file is located in.

At least that is the case for Tier1.

For Tier2 (which is what your code snippet would indicate that you are using), it appears the default location is the same directory as the executable.

It's not impossible that the '/' should be '\\' in your LoadSound call. I found that MS VS compiled stuff doesn't always respect the *nix path notation.

Cheers,
Ancient Lady
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 6th Apr 2012 17:34 Edited at: 6th Apr 2012 17:35
Quote: "It's not impossible that the '/' should be '\\' in your LoadSound call. I found that MS VS compiled stuff doesn't always respect the *nix path notation."

I tried both, without success

Quote: "For Tier2 (which is what your code snippet would indicate that you are using), it appears the default location is the same directory as the executable."

It seems that there is no other explanation...
Thanks a lot
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Apr 2012 02:22
AGK enforces media to be in a sub folder relative to the exe, this is to match mobile devices that won't let you ../ out of the main app directory, so this would cause problems with cross platform compatibility.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 8th Apr 2012 19:59 Edited at: 8th Apr 2012 20:01
Quote: "AGK enforces media to be in a sub folder relative to the exe, this is to match mobile devices that won't let you ../ out of the main app directory, so this would cause problems with cross platform compatibility. "

I suppose images are media also. I can load them though using directories like these in the code snippet above. Is there any special care on mobile platforms for music and sound?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 8th Apr 2012 23:09
just take care of file naming, cos many platforms are case sensitive.

what i do is always use lowercasing for filenames, it never fails... though you can use any casing you want.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Apr 2012 04:47
Quote: " I can load them though using directories like these in the code snippet above. Is there any special care on mobile platforms for music and sound?"


All media will have to be a sub directory of the app for mobile devices, no browsing up to parent directories and then down into another sub folder.

Also MP3 is supported on all platforms but if you are worried about licensing you may want to use m4a instead which is royalty free and has hardware decode on most mobile devices.

Login to post a reply

Server time is: 2024-05-08 14:08:52
Your offset time is: 2024-05-08 14:08:52