Android Music & SFX GLB 11 & 12

Previous topic - Next topic

erico

Got v12 running, at first it didn´t want to compile android, after deleting things here and there and restarting it works and compile.
But that puts me on your position, no sound working at all on android.

I will try the path things now...

spicypixel

Here is the same puzzle.ogg at 44100Hz, 16bit, Mono and this does play correctly (no clicks) in v10, so you have two oggs to play with now. See if we can get these audio issues tied down once and for all regarding file rates, glb versions and such :) Thanks again for your continued testing.
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.

SnooPI

spicypixel try this :

- clean your project
- put all sounds and music in a shoebox
- use SETSHOEBOX function before loadsound an playmusic


erico

#18
Got it working on v12.
Thanks to FiveSprite´s post on glb12 thread. :-[

I took out the setcurrentdir command and added like"Media/" to all loading commands. So it looks like this for example:
PLAYMUSIC "Media/daXX - Paranoimia - daXX Remix.ogg", FALSE

So all sounds, wav and ogg, are playing perfectly on android here.
But this is on my code.

Will try that on your code and file now Spicy.

edit: tested with your files, things play on android but the sound is noisy...feels like a bad sound convertion...will look the later file too

erico

Your last ogg file plays fine on android under your test example.
Here the apk, check it out.

So it is probably a sound conversion problem.

Will take a closer look into the ogg waves and format now. I know some simple sound conversion can destroy a tune and that some synth instruments really require pro equipment to play otherwise it craps all up on the speakers.

ps: both sound waves look ok (if a bit low on volume) all is fine on this front. Playing your file on android winamp reproduces it correctly, so I guess GLB does not like 22050hz? Will re-check this... Forum limit file size is 8mb, can´t upload the zipped apk.

erico

Ok, it is not a conversion problem, I resampled it here to 22050 with the higher quality file (even setting high quality ogg when saving) and I get the same result, music full of clicks. Again, playing same files on a music player on android plays fine.

Using your full quality music in app also did play fine.
So maybe 22050 is not android GLB´s taste?

Tried the 44100 version but reduced ogg quality on save to 0...file is smaller but I get the same problem.
Plays fine on player, stutters under a GLB app.

erico

We could test a range of varieties of ogg files to check which are going good.

But now I wonder, this has absolutely nothing to do with android APIs right?
I have below zero knowledge on android APIs, before we test it, does anyone know if this could play a role?

spicypixel

I was out last night but have just read through your comments and testings. It does seem that the fault is inherent with GLB if the same file plays flawlessly under a music player on Android. I like the tune so will keep it, although it does look like I will have to keep the 44100Hz version to play correctly. Strange but true....

I will also remove the SETCURRENTDIR command and reference the graphics and sound via the "Media/xxx" method if this indeed is the only way to solve things. I would still like some other feedback though on what are the correct settings for playback with GLB. Or if there is some limitation on the audio engine that we are not aware of.
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.

spacefractal

uses full path for android and uses 22khz momo. this is what im do and that seen fine. you cant hear different from 44kz and 22kz anyway on Android at all and is fully suitable for games.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

That is going fine for me in WAV, but in OGG it is glitchy on 22khz.

fuzzy70

Quote from: spacefractal on 2013-Nov-21
you cant hear different from 44kz and 22kz anyway on Android at all and is fully suitable for games.

In some ways true. If playing through 99% of phones/tablets tiny little single speaker then yes. Put your headphones/earbuds on & the difference is quite noticeable dropping to 22khz. The same goes for mono through headphones in that the most music runs the risk of becoming flat/dull when converted down to mono unless it was composed/written with that in mind.

I have to admit I might be slightly biased with regards to this as I am an Audio/Visual technician by trade so my hearing notices such differences as it's a requirement for my work  =D

Lee 
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

erico

Fit me in that description too.

I´m keeping my music (OGG) in stereo 44 for the exact reasons you stated, even though size is going to be big.
But OGG is quite an adaptable format, using 44 with lower codec quality could do the trick and be passable, problem is GLB is not playing OGGs correclty on android if not in high quality.

I have a sound card capable of 24bits 115khz and a sound system able to mostly reproduce it on desktop, so even changing to the onboard sound system couses me shwricks. :D

It would be nice to know how much we can push OGG on android with GLB, since if a game has 10 songs it could easily mean 20-30mb of music data alone. Is anyone compiling to android, probably a higher API, and using a lower quality OGG with success?

spicypixel

There's definitely an issue when using 22KHz compared to 44KHz on GLB (I'm sure not with all tunes??) in OGG format. The puzzle.ogg I uploaded represents such an issue as erico has stated. The tune is pretty much unrecognisable when using 22KHz with the attached files I have put up. This is not a conversion issue and can only be a playback issue (certain frequencies?).
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

Some extra info.
Here the oficial codec support from android:
http://developer.android.com/guide/appendix/media-formats.html

As you can see, OGG+vorbis is natively supported on that platform.
There isen´t much extra information/reserves about specs of the music file so I take it plays all variations.

Digging around the interwebs, I found a post about OGG that raised my question about possible relationship with API:
QuoteAndroid 2.3 and up uses OpenSL ES API, which has great support for MP3. All previous versions and bugs and difficulties with audio here and there. I would still go with MP3 for earlier API versions. Ogg would be a pain to implement. In fact, before Android 2.3 API (version 9, I believe), there were lots of complaints about developing any kind of audio applications for Android.

CORRECTION Android does have .ogg compatibility starting with API version 8.

I´m not sure this has any role into the problem. My GLBv12 states it is using ANDROID API-8 when compiling.

spacefractal

Im would uses adpcm sound if that was possible. Most target people would not notice it, not on android, and is a kind trade off and also to safe file size and memory.

For jungool, we used 22 kHz adpcm mono for sound and stereo 96kbit mp4 for music. For greedy mouse it's 22khz PCM mono for sound and 44khz 128kbit ogg stereo for music.

On android you even need to dither your graphics to rgb565 to avoid color banding, but was not required that in greedy mouse.

So it's bits of trade offs here and there.

There is a alternative sound/music API in androidextras to tryout as well.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/