Musik oder Ton auf Android packen?

Previous topic - Next topic

LukasOK

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:!

Ian Price

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.
I came. I saw. I played.

LukasOK

Aber die Datei ist eine (.wav) Datei. Sie ist auch komplett kleingeschrieben.

Ian Price

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"
I came. I saw. I played.

LukasOK

Ja aber was ist dan mit PLAYMUSIC soll da auch LOADSOUND?

Ian Price

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


I came. I saw. I played.

LukasOK

#6
Ich habe das aber benutzt ich haben:

PLAYMUSIC "Music.wav", TRUE

Wenn ich daraus dann:

PLAYMUSIC "Media/Music.wav", TRUE

Habe ich keinen Ton.

Ian Price

Have you tried using Android Extras? That might help. Android is a PITA with sound and directories. :(
I came. I saw. I played.

erico

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.

LukasOK

Geht das nicht einfach so ohne den Datei Type zuänder?

LukasOK

Wenn ich die Frage stellen darf: Wie würdet ihr das den schreiben`?

erico

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.

LukasOK

Also soll ich nur den Datei Type ändern?

erico

Yes, for Android, use ogg(vorbis) music.
Wav is not working here on my galaxy note 2. For sound effects it works fine.

LukasOK

So hab alles versuch....

Auch wenn ich den Datei -Type ändere höre ich sogar am PC nichts mehr.