P PharCyDeD Active Member Licensed User Longtime User Feb 16, 2012 #1 I have a few mp3's in my project. I know the sound works and the code works because I can hear the other sounds. Here is what I have: Code: Dim SP As SoundPool Dim LoadId1, PlayId1, LoadId2, PlayId2, LoadId3, PlayId3, LoadId4, PlayId4 As Int Code: SP.Initialize(4) LoadId1 = SP.Load(File.DirAssets, "button-10.mp3") LoadId2 = SP.Load(File.DirAssets, "button-6.mp3") LoadId3 = SP.Load(File.DirAssets, "button-7.mp3") LoadId4 = SP.Load(File.DirAssets, "GameMusic.mp3") Code: PlayId4 = SP.Play(LoadId4, 1, 1, 1, 0, 1) I added the file to my project and everything but I hear nothing? Is there a limit on playback length or size?? It is only 1:14 and 2mb'ish. GameMusic is the file that won't play. Last edited: Feb 16, 2012
I have a few mp3's in my project. I know the sound works and the code works because I can hear the other sounds. Here is what I have: Code: Dim SP As SoundPool Dim LoadId1, PlayId1, LoadId2, PlayId2, LoadId3, PlayId3, LoadId4, PlayId4 As Int Code: SP.Initialize(4) LoadId1 = SP.Load(File.DirAssets, "button-10.mp3") LoadId2 = SP.Load(File.DirAssets, "button-6.mp3") LoadId3 = SP.Load(File.DirAssets, "button-7.mp3") LoadId4 = SP.Load(File.DirAssets, "GameMusic.mp3") Code: PlayId4 = SP.Play(LoadId4, 1, 1, 1, 0, 1) I added the file to my project and everything but I hear nothing? Is there a limit on playback length or size?? It is only 1:14 and 2mb'ish. GameMusic is the file that won't play.
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #2 I tried adding the sound file to the simple SoundPool example and when I do all sounds stop working and the sound doesn't play. Has anyone else experienced anything like this? Should I try to convert the files? Any recommended converters to try? Upvote 0
I tried adding the sound file to the simple SoundPool example and when I do all sounds stop working and the sound doesn't play. Has anyone else experienced anything like this? Should I try to convert the files? Any recommended converters to try?
JonPM Well-Known Member Licensed User Longtime User Feb 17, 2012 #3 Maybe just that one is bad? Sent from my DROIDX Upvote 0
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #4 Well the file plays fine on my computer, but I am unsure of what makes a sound file "bad" to B4A. Does anyone know the criteria in which B4A looks for in a sound file? I ran the file through a converter that I bought awhile back (and honestly forgot about but finally got to use it again lol) but still have had no results. I just don't understand what makes it unacceptable. Normally I would forget about it and just move to a new file, but I have licensed this particular music for the app. So not using the file = wasted money Upvote 0
Well the file plays fine on my computer, but I am unsure of what makes a sound file "bad" to B4A. Does anyone know the criteria in which B4A looks for in a sound file? I ran the file through a converter that I bought awhile back (and honestly forgot about but finally got to use it again lol) but still have had no results. I just don't understand what makes it unacceptable. Normally I would forget about it and just move to a new file, but I have licensed this particular music for the app. So not using the file = wasted money
stevel05 Expert Licensed User Longtime User Feb 17, 2012 #5 The audio formats supported by Android are here, there shouldn't be any surprises with MP3, but you could always try converting it to ogg Vorbis. Upvote 0
The audio formats supported by Android are here, there shouldn't be any surprises with MP3, but you could always try converting it to ogg Vorbis.
thedesolatesoul Expert Licensed User Longtime User Feb 17, 2012 #6 Maybe it has something to do with DRM? compare the mp3 header with one that works. Upvote 0
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #7 I have converted to .ogg, .wav, and even lower quality .mp3. It really doesn't make sense to me :BangHead: Upvote 0
I have converted to .ogg, .wav, and even lower quality .mp3. It really doesn't make sense to me :BangHead:
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #8 How do I compare the header? I compared the two by right-clicking and going to properties/details and the only difference I could see is the bit rate is 128 for one and 320 for the other. It says "No" in the protected area for both. Upvote 0
How do I compare the header? I compared the two by right-clicking and going to properties/details and the only difference I could see is the bit rate is 128 for one and 320 for the other. It says "No" in the protected area for both.
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #9 If anyone is willing to give it a shot at working with it please let me know and I can send the file over. :sign0163: Upvote 0
If anyone is willing to give it a shot at working with it please let me know and I can send the file over. :sign0163:
stevel05 Expert Licensed User Longtime User Feb 17, 2012 #10 Yes, I'll pm you my email. I can try it on the few devices I have and see. Upvote 0
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #11 Thanks steve. I sent over the file along with one of the working mp3's as well. Let me know how it goes. Upvote 0
Thanks steve. I sent over the file along with one of the working mp3's as well. Let me know how it goes.
margret Well-Known Member Licensed User Longtime User Feb 17, 2012 #12 Try renaming the file to all lower case letters and load as lower case letters and see if it will play. I have run into this before. Upvote 0
Try renaming the file to all lower case letters and load as lower case letters and see if it will play. I have run into this before.
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #13 I tried renaming it to all lowercase and it didn't work still. I even converted to .ogg and renamed it as well with no success. Thank you for giving me something to try though. I am willing to give anything a go in order to get this working. Maybe stevel05 will have good news. Upvote 0
I tried renaming it to all lowercase and it didn't work still. I even converted to .ogg and renamed it as well with no success. Thank you for giving me something to try though. I am willing to give anything a go in order to get this working. Maybe stevel05 will have good news.
stevel05 Expert Licensed User Longtime User Feb 17, 2012 #14 I got your file, when I tried loading it, in the unfiltered logs I got the error message: Heap size overflow! req size: 1052672, max size: 1048576 and found a corresponding question on stack overflow Android Soundpool problems - Stack Overflow. Not good news I'm afraid, perhaps you can play the music with mediaplayer without the two clashing? (I did test is on the stand alone media player and it plays fine). Upvote 0
I got your file, when I tried loading it, in the unfiltered logs I got the error message: Heap size overflow! req size: 1052672, max size: 1048576 and found a corresponding question on stack overflow Android Soundpool problems - Stack Overflow. Not good news I'm afraid, perhaps you can play the music with mediaplayer without the two clashing? (I did test is on the stand alone media player and it plays fine).
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #15 Well at least I have my answer now. I can't seem to find anything about the MediaPlayer though. How can I see how it is used? Any example sources available? Upvote 0
Well at least I have my answer now. I can't seem to find anything about the MediaPlayer though. How can I see how it is used? Any example sources available?
P PharCyDeD Active Member Licensed User Longtime User Feb 17, 2012 #17 omg man thank you so much. The mediaplayer works!!!! :wav: I owe you a drink or two Upvote 0
thedesolatesoul Expert Licensed User Longtime User Feb 17, 2012 #18 Also for usage suggestions of SoundPool and MediaPlayer: Android: Soundpool vs MediaPlayer (focus on soundboards and memory problems) | Stealthcopter.com Upvote 0
Also for usage suggestions of SoundPool and MediaPlayer: Android: Soundpool vs MediaPlayer (focus on soundboards and memory problems) | Stealthcopter.com