Android Music & SFX GLB 11 & 12

Previous topic - Next topic

spicypixel

I am getting very confused that the only version of GLB that works at all for Android regarding sound is Version 10 (and there's latency on the sfx there too). GLB v11 and v12 both fail BIGTIME in playing WAV or OGG files. I have created an APK using GLB 10 that works fine albeit the latency which I believe is a java android issue anyway, although I have a Sony Xperia SP on 4.1.2 so I would have though that would have been fixed by now so is this latency a GLB issue instead?

Working fine on GLB 10
Music: OGG 44100Hz, 96Kbs (low but fine), Mono, 16Bit
SFX: WAV 44100Hz, Mono, 16Bit

Unless I'm creating a Charlie Chaplin game I might be struggling with v11 & v12, unless anyone can tell me different lol :D
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

erico

Here v10 and 11 works similar, I haven´t tried v12 yet.
Sound stutter a bit when repeated, some kind of samples/duration seem to not stutter that much.

spacefractal

Engine is the same. If you are concern about it. There is a alternative API in androidextras.

I'm uses 22kz my self. No reason do uses more than that.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

I haven't tried V12 yet on Android, but I dont see music being a problem...

MrPlow

my ogg file works fine on my Android app on GLBv12...I also used full paths for the sounds...

LOADSOUND "Media/clockclick2.ogg",1,1
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spicypixel

So if I use...

LOADSOUND GETCURRENTDIR$ + "Media/sfx/filename.wav", sfx%, 2
PLAYMUSIC GETCURRENTDIR$ + "Media/music/filename.ogg", sfx%, 2

This works fine for both v11 & v12?

If this is the case there really should be a sticky at least until this path bug is fixed surely. I have searched for Android sound on the forum and have had a number of conflicting discussions on this topic. Thanks for the replies I will indeed try the paths to see if it fixes the issue.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

MrTAToad

You shouldn't need to use GETCURRENTDIR$() - Doing LOADSOUND "Media/xx" should be enough

SnooPI

Quote from: spacefractal on 2013-Nov-19
Engine is the same. If you are concern about it. There is a alternative API in androidextras.

I'm uses 22kz my self. No reason do uses more than that.

yes, work fine for me (with glb 11 and 12)

22kz is is the right frequency for android (until glb use the very good 3d audio library : opensles   ;) gernot)

spicypixel you should use audacity to convert your sound and music.
audacity.sourceforge.net

spicypixel

#8
Already use Audacity cheers

In GLB12 I get no audio whatsoever in my APK. I'm using this for loading sounds & playing music.

sfx_paws%   = GENSOUND()
LOADSOUND "Media/sfx/paws.wav"  , sfx_paws%, 2

PLAYMUSIC "Media/music/puzzle.ogg", TRUE

Top of my code I have a SETCURRENTDIR("Media") command anyway but apparently this makes no difference. I get no audio in 12.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

spicypixel

Here is a stripped version of my game with only the sound bits, could someone test this and see what results they get please.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

erico

#10
It dosen´t work here on v10 neither with my own working ogg files. (don´t bother this, my win dosen´t play oggs anyway)
Your ogg seems to be fine, looks like path problems.

back on the music stuttering, I might not have expressed myself correctly, I meant all sounds play perfectly but sounds you want to repeat (machine gun shots for ex)...those don´t quite kick in in loop and sometimes are completely skipped.

Let me look at the code example again...

edit:will do an apk to check this better

erico

The paths you did there did not work for me, so just in case I changed things to:

Code (glbasic) Select
SETCURRENTDIR("Media")
SETSCREEN 640, 480, 0

GLOBAL sfx_paws%, sfx_bark%, sfx_bone%, sfx_button%, sfx_touch%

sfx_paws%   = GENSOUND() ; LOADSOUND "Media/sfx/paws.wav"  , sfx_paws%, 2
sfx_bark%   = GENSOUND() ; LOADSOUND "Media/sfx/bark.wav"  , sfx_bark%, 1
sfx_bone%   = GENSOUND() ; LOADSOUND "Media/sfx/bone.wav"  , sfx_bone%, 1
sfx_button% = GENSOUND() ; LOADSOUND "Media/sfx/button.wav", sfx_button%, 1
sfx_touch%  = GENSOUND() ; LOADSOUND "Media/sfx/touch.wav" , sfx_touch%, 2

PLAYMUSIC "puzzle.ogg", TRUE


SHOWSCREEN
MOUSEWAIT
END


That way plays fine here, but the music plays garbled full of ticks. That dosen´t happen with my ogg game music and neither playing your music on a desktop player.

If it is the ticks that are bothering you, it may be related to the synth instruments in song?
I didn´t try v12 as I haven´t installed yet.

I hope this info helps you somehow, I should get v12 these days and I may test it better there.

erico

Wait, the code I posted didn´t work on v11.

I will get v12 going and let you know, I must check that sound routine is working on my game too.
I still suspect it relates to path.

spicypixel

Quote from: erico on 2013-Nov-19
The paths you did there did not work for me, so just in case I changed things to:

Code (glbasic) Select
SETCURRENTDIR("Media")
SETSCREEN 640, 480, 0

GLOBAL sfx_paws%, sfx_bark%, sfx_bone%, sfx_button%, sfx_touch%

sfx_paws%   = GENSOUND() ; LOADSOUND "Media/sfx/paws.wav"  , sfx_paws%, 2
sfx_bark%   = GENSOUND() ; LOADSOUND "Media/sfx/bark.wav"  , sfx_bark%, 1
sfx_bone%   = GENSOUND() ; LOADSOUND "Media/sfx/bone.wav"  , sfx_bone%, 1
sfx_button% = GENSOUND() ; LOADSOUND "Media/sfx/button.wav", sfx_button%, 1
sfx_touch%  = GENSOUND() ; LOADSOUND "Media/sfx/touch.wav" , sfx_touch%, 2

PLAYMUSIC "puzzle.ogg", TRUE


SHOWSCREEN
MOUSEWAIT
END


That way plays fine here, but the music plays garbled full of ticks. That dosen´t happen with my ogg game music and neither playing your music on a desktop player.

If it is the ticks that are bothering you, it may be related to the synth instruments in song?
I didn´t try v12 as I haven´t installed yet.

I hope this info helps you somehow, I should get v12 these days and I may test it better there.

Did you try and play the sound files? I know I didn't include them in the test only the playmusic command. Im presuming you're testing with 11? Thanks for the feedback erico.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

erico

I tried only the music file puzzle.ogg

Works on desktop with VLC fine. Its own analyses points to a correct file format.
It works on android here from v10...but here, it plays with lots of clicks and hisses.

V11 didn´t find the the file I suspect, so it didn´t play at all.
I´m installing v12 here now will let you know more and also test my stuff.