GLBasic forum

Other languages => GLBasic - de => Topic started by: LukasOK on 2015-Nov-13

Title: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-13
Hi Leute,

Lang nichts mehr von mir gehört  =D

Kurze Frage wenn ich Musik in mein Spiel packe und auf Android umwandel, fehlt die Musik.
Woran kann das liegen?
Muss ich die Datei mitgeben?

Danke im Voraus wenn jemand was drüber weis :good:!
Title: Re: Musik oder Ton auf Android packen?
Post by: Ian Price on 2015-Nov-13
It's likely to be either the format - try to use .ogg, the wrong bitrate of the music or the file path. Try playing a .WAV file instead. If it plays, it's probably not the path.

Another thing could be case-sensitivity. On windows it doesn't matter if the file is called "fred.MP3" and you try to load "fred.mp3" on Android that will fail; it has to match exactly.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-14
Aber die Datei ist eine (.wav) Datei. Sie ist auch komplett kleingeschrieben.
Title: Re: Musik oder Ton auf Android packen?
Post by: Ian Price on 2015-Nov-14
In that case its either the path (most likely), or the bitrate of the .wav

Try PCM 44.100 kHz, 16bit stereo works for me.

When loading your sound file, use the containing folder in the name eg -

Code (glbasic) Select

LOADSOUND ("Media/sound.wav"),1,1


Don't use "SETCURRENTDIR"
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-16
Ja aber was ist dan mit PLAYMUSIC soll da auch LOADSOUND?
Title: Re: Musik oder Ton auf Android packen?
Post by: Ian Price on 2015-Nov-16
It was a test for the path - if the sound loads and plays, then the path is likely to be correct and your music should play.

If the sound plays then try using the same format for your music eg

Code (glbasic) Select

PLAYMUSIC "Media/music.ogg",TRUE


Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-16
Ich habe das aber benutzt ich haben:

PLAYMUSIC "Music.wav", TRUE

Wenn ich daraus dann:

PLAYMUSIC "Media/Music.wav", TRUE

Habe ich keinen Ton.
Title: Re: Musik oder Ton auf Android packen?
Post by: Ian Price on 2015-Nov-16
Have you tried using Android Extras? That might help. Android is a PITA with sound and directories. :(
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-17
Use .ogg (vorbis) format for android music and the full path as Ian stated, it works for me fine.
I haven´t tried .wav for music on android yet, so I´m not sure. You can also use impulse tracker files .it.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-18
Geht das nicht einfach so ohne den Datei Type zuänder?
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-18
Wenn ich die Frage stellen darf: Wie würdet ihr das den schreiben`?
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-19
I didn´t understand the question, what is schreiben?

Also, in case you need to convert an audio file to ogg, you can use vlc player or audacity.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-19
Also soll ich nur den Datei Type ändern?
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-19
Yes, for Android, use ogg(vorbis) music.
Wav is not working here on my galaxy note 2. For sound effects it works fine.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-19
So hab alles versuch....

Auch wenn ich den Datei -Type ändere höre ich sogar am PC nichts mehr.
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-19
I´m not sure I understood your answer, try using traditional gramatic germany because it is easier for google translator to do its job.

Anyways, for android, I use ogg, for pc, I can use wav or mp3.
Ogg will play on VLC on my pc but it won´t play inside my GLB.

I´m uploading the music file I used to test to a temporary folder online,
try to play that on android, use full path and playmusic.
It works fine here.

Get the ogg test music from here:
https://www.wetransfer.com/downloads/65ca9dd81ddfcac8ee4fbba97135e57720151119195741/2ec8edaa6bef55394ac1bccb3c82492120151119195741/135c3f
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-20
(English)
Hello,
I did the test song (Daxx - Paranoimia - Daxx Remix.ogg)

I have done so
Code:

PLAY MUSIC "Daxx - Paranoimia - Daxx Remix.ogg" TRUE
.....

I have still no sound. Do I need have the Media Folder for Android?

(Deutsch)
Hallo,
Ich habe den Test Song (daXX - Paranoimia - daXX Remix.ogg )

Ich habe es so gemacht

Code:
PLAYMUSIC "daXX - Paranoimia - daXX Remix.ogg", TRUE
.....

Ich habe trotzdem keinen Ton.
Muss ich den Media Ordner für Android haben?
Title: Re: Musik oder Ton auf Android packen?
Post by: Ian Price on 2015-Nov-20
It's worth trying the media folder

Code (glbasic) Select
PLAYMUSIC "Media/Daxx - Paranoimia - Daxx Remix.ogg" TRUE
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-21
Exactly. And make the file is actually inside the media folder. ::) :-[
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-22
OK, it is was trying
did not function.
I still have no sound.
If anyone knows.
He might make an example?
Please ::) ;)
I tried it is with other projects but has brought nothing.
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-22
Check this thread here:
http://www.glbasic.com/forum/index.php?topic=9933.msg86777#msg86777

You can use that project as a test, it is playing mod and it.
Just add an ogg music to midia folder and rename it and match it in code and it should work out.

It works fine on android, but not on my windows pc.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-27
Ok it works,
still:
Also with sound: "PLAYSOUND"?
But when I finish the program on Android runs it even further,
Can you also stop the sound?
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-27
With PLAYMUSIC use STOPMUSIC.
With PLAYSOUND use STOPSOUND.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-28
Sorry but some projects will not do
Windows = wav
Is working
Android = ogg
It does not work
what you why?
Title: Re: Musik oder Ton auf Android packen?
Post by: erico on 2015-Nov-28
I have tested ogg here on android and it seems to work fine on my phone and others, I have a galaxy note II.

My ogg is formated as:
16bit 44100 stereo

OGG not only for the encapsulator but the codec must be ogg vorbis.

It should work, if it dosen´t, post the code and APK you have so I can check it out on hardware.
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Nov-29
I want to use it with other types times.

Are there any side ogg other types?
Title: Re: Musik oder Ton auf Android packen?
Post by: LukasOK on 2015-Dec-18
Ich danke für alle Antworten :good: