PLAYMUSIC behaviour I can't understand

Previous topic - Next topic

dbots

Hi all,

I 've written a small sample game and use some mp3 sounds (with playsound) and all is fine.
My problem starts when I use playmusic, in order to add a continuous background music in the game.

What I do in code, is to call :
PLAYMUSIC "bgmusic.wav", TRUE
MUSICVOLUME 1
at the beginning of the project, having enabled :
SETCURRENTDIR("Media")
also at first line just before everything

The strange thing is that when I test the project on windows background music plays just fine but when I transfer the game on my Android device then I don't background music. My Android's version is 2.3.
I have tried both with mp3 and wav sound for background, the result is always negative.
Also, I have all graphics and sounds in the Media folder under the .app folder generated for the project and when I build the apk I see that all multimedia files are placed correctly under assets/Media, so it's not that files are missing.
Thank you in advance

Marmor

u need the right samplerate !  44100 /stereo

mentalthink

Hi dbtos Welcome to the Community, try to change the format to .ogg, In android the extensions of audio changes , I think not it's equal in all Android Versions...

This info I think you can find in Internals of the Help, or in the Book of Mrtatoad, on you will learn all about Glbasic, tricks and tips...  It's in Lulu books, but in UK Market (Find something GLbasic, you can find some books, but it's programmig guide or something like this). * Very cheaper

dbots

Thank you mentalthink, I will try that and post the results.

dbots

Well, I replaced the music file with an OGG type format, now I hear something but it's not the music, it has too much noise.
Probably I must change the sampling rate or something else or maybe the Android version is old ?
Where can I find detailed information about all these ?
Thank you

erico

You could use audacity to change format on your music.
http://audacity.sourceforge.net/

16bit 44100 stereo OGG, is what I think is needed.


dbots

Yes my friend, that's what was needed. I setup OGG to 44100 and background music is crystal quality without noise.
Thank you all for your help.

mentalthink

Hi dbots, if need a very usefull and free tool, and batch converter for change the files of audio, try this...

http://www.freemake.com/es/free_audio_converter/

This program works very fine, I change about 1500 audio files in only one click for my projects... Only you have take in mind the Sample Rate, I always forget wich it's...  :S

For image you have similar tools... I think in the Spaninsh forum you can find some post i put sometime ago, whit some usefull and free converters and another simple tools...

Regards, and happy for you can hear you android  :good:

dbots

Thank you mentalthink, I have been using Audacity and tools like GIMP and Paint.NET but for batch conversions I will have in mind what you suggest. BTW, I don't know Spanish at all :)

mentalthink

Don't care if you need commnet me, and I pass the post...  :good: