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.

AppGameKit Classic Chat / Certain sounds not playing?

Author
Message
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 3rd Aug 2016 07:43
Hi all, I've seen the posts describing the very specific format details that audio files need to work in AppGameKit, but I'm still having certain sounds not work on Android, regardless of whether I use the correct formatting or not... I'm rendering all my sounds as 16 bit, 44,100hz Stereo PCM WAV files and some of them simply won't play... Has anyone had this happen at all, and better yet, found a solution?

What do people use to render their audio? I'm using Audacity.
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 3rd Aug 2016 09:49
Hey, if you want email me the sounds and I can take a crack at re-building them. I've had this problem also, I'm not exactly sure what is going on, but I've found a couple solutions to fixing the problem using Audacity and re-rendering the sounds. I couldn't tell you if it's an error having to do with AppGameKit or certain sound drivers and playback certain .wav formats.

All I know, one of two of my solutions works every time. If I get them to work, I'll send you the Audacity files with the saved format properties so you have a template to fix any future sounds.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 3rd Aug 2016 15:52
There is another thing, Android filesystem is case sensitive. Windows filesystem is not. So if you develop on Windows it can be hard to tell if all characters in a filename is lowercase as Windows does some "prettying up" to the filenames. You can turn this off in Windows, search on Google for Windows "Dontprettypath", and remember to turn on "show fileextensions for known file types" so you can see the correct upper and lower cases for the filename extension as well.

Here is a webpage that tells how to do it (you have to edit your registry database, so be carefull!): http://windowsitpro.com/systems-management/how-can-i-stop-windows-explorer-changing-case-my-filenames
13/0
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 4th Aug 2016 12:33
Hi Cybermind. I gave that a try, but unfortunately that's not what's doing it.

Thanks for the offer, JLMoondog. I'll send them through! You'd be a lifesaver if you got those settings to me!
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 6th Aug 2016 06:59
Email sent!
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 7th Aug 2016 11:20 Edited at: 7th Aug 2016 11:22
Use OGG sounds (LoadSoundOGG). The files are smaller. The reading of it is faster. The compatibility is perfect.
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 7th Aug 2016 12:35
Nope. Tried that. Still doesn't work for those sounds.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Aug 2016 13:46
Quote: "Nope. Tried that. Still doesn't work for those sounds."


You have to convert them to OGG format first.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 8th Aug 2016 04:42
Yes, I know that. I converted them. But what I mean is that it's the same sounds which have the problem, despite conversion.
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 8th Aug 2016 08:20
It's already been said, but it's worth repeating just to be sure... Android is very case sensitive, doing LoadSound ("sound.wav") will not work with a filename of 'Sound.wav'

Using AppGameKit V2 Tier 1
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 8th Aug 2016 08:43
Yep. Tried that aspect. Even tried the "pretty text" check to make sure Windows wasn't playing any funny business. It's all ok on that score.
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 10th Aug 2016 13:05
Hi, I've also noticed this problem with one or two sounds so decided to try a few things to see if I could narrow the problem down.

What I have found so far is that small file size and/or short sound duration definitely affect whether sounds can be heard when I export to android.

Files below 9KB produce no detectable sound, but more importantly sound length less than about 170ms do not provide sound.

Files greater than this, even the original ones lengthened, do sound ok.

I wonder if you can check these figures with your sounds that do not sound to see if we are getting anywhere?
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 10th Aug 2016 20:37
@Juney:
I have been going crazy trying to work out why one of my button sounds wasn't working on certain Androids (It didn't work on my Note 3, but it worked ok on my old Galaxy Tab 2). After reading through your post, I noticed that the file in question was 9500 bytes in size, so I padded the end of the file with silence bringing the size up to 15332 bytes and now it magically works

Thank you very much
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Aug 2016 20:47
Well, at least we have a possible answer to this issue.
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 11th Aug 2016 10:39
Hi =PRoF=, thank you for doing a test which helps enormously.

I can now confirm that both the file size and sound length determine whether a sound is audible. We are talking .ogg files here.
I have managed to get sounds around 8500 bytes working but with sound length => 170ms, but anything smaller, length or size, doesn't work for me.

By padding the end of your file with "silence", which is what I did, both increases the file size slightly but more importantly must have increased the file length to more than 170ms.

Foe ease of measurement i'm guessing that it may be safe to say .ogg sound files should be 12KB or greater to be reasonably certain of them working.

If anyone finds this doesn't work then please post so the figure can be revised, after which Paul may be able to include something in the "Help" guide.

Cheers
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 11th Aug 2016 12:16
Yes! All the sounds that have been causing the issue have those traits. Brilliant!

What an odd bug, though!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Aug 2016 17:16
I'll make the Android version pad sounds shorter than 175ms with silence in the next version so hopefully this won't be problem.
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 17th Aug 2016 20:34 Edited at: 17th Aug 2016 20:53
Quote: "I'll make the Android version pad sounds shorter than 175ms with silence "


Thanks Paul but that won't stop some problems as the .ogg sound file size also needs to be estimated > 8500B, even larger to be safe.

Example a very short beep padded with silence to 180ms may only have a file size of about 5-6KB depending upon volume amplitude and will not play, so its not just a case of sound length, although it is one main factor. Its also a case of increasing the sound file size, whether by increase in volume, channels, bit rate or sample rate(frequency), sound length or any combination of these.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Aug 2016 20:39
A small OGG file shouldn't have any effect, and I haven't been able to replicate such a problem. The OGG file is decompressed into WAV data before it gets to the Android code.

Login to post a reply

Server time is: 2024-09-29 17:21:51
Your offset time is: 2024-09-29 17:21:51