It looks like you're new here. If you want to get involved, click one of these buttons!
[Music]
Music = music.ogg
Loop = true
KeepInCache = true
Volume = 0.7
[ShootEffect]
Sound = shoot.ogg
Loop = false
KeepInCache = true
Volume = 0.7
orxSOUND *pstMusic = orxSound_CreateFromConfig("Music");
orxSound_Play(pstMusic);
orxSOUND *pstShoot = orxSound_CreateFromConfig("ShootEffect");
orxSound_Play(pstShoot);
[SOUND] [orxSound.c:orxSound_createFromConfig():629] Can't create sound <ShootEffect>: invalid content.
[ASSERT] [orxSound.c:orxSound)Play():1043] [ASSERT] : <(_pstSound != orxNULL) && (((((orxStructure *)(_pstSound))->u64GUID & orxSTRUCTURE_GUID
[ShootEffect]
Music = shoot.ogg
Loop = false
KeepInCache = true
Volume = 0.7
Comments
what if your reencode this .ogg in .mp3 ?
Desktop version is also not happy with the mp3's and has a slightly different message:
It's only supported on iOS and Android.
I can only guess that there may be something about my sample format that is upsetting android when played as a sound as opposed to music.
They're 44100hz 16-bit stereo oggs/mp3s. I am not aware of any format recommendations.
it's very weird, never had such issue
I've just pushed a small fix, but I don't think it will fix your issue...
lydesik
Some interesting results:
I re-tried the orx bounce demo (with the bip.ogg sound file) on the Motorola Xoom and all is fine.
I swapped the bip.ogg for my shoot.ogg and renamed it to bip.ogg. When running the demo, I get no sound effect, but several messages:
The difference above, these errors don't crash the demo. But either way, is doesn't like my ogg file.
Despite the error, the 'Bip' section is clearly there in the config. All that has changed is the content of the bip.ogg.
Next experiment, changing my shoot.ogg to be copy of the bip.ogg file (in my game).
Low and behold I hear the sound, but then the game crashes, and the Xoom starts shutting down due to the battery. So now I can't prove if the crash was the result of the battery until the morning when I get back to work where the charger is.
So assuming that all is fine, comparing the difference between the files:
shoot.ogg
Format : OGG
File size : 64.4 KiB
Duration : 3s 529ms
Overall bit rate : 149 Kbps
Format : Vorbis
Format settings, Floor : 1
Bit rate mode : Constant
Bit rate : 160 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Stream size : 68.9 KiB
Writing library : libVorbis 1.2 (UTC 2007-06-22)
bip.ogg
Format : OGG
File size : 6.10 KiB
Duration : 165ms
Overall bit rate : 303 Kbps
Format : Vorbis
Format settings, Floor : 1
Bit rate mode : Constant
Bit rate : 96.0 Kbps
Channel(s) : 1 channel
Sampling rate : 44.1 KHz
Stream size : 1.93 KiB (32%)
Writing library : libVorbis (Schaufenugget) (20101101 (Schaufenugget))
The interesting differences (potential issues) are highlighted in red above.
My guess is that it is down to either a file size or duration limitation, the number or channels, or the library that wrote the file.
I'll toy with my file and match the differences tomorrow night to find out what it is.
the only diffrence is that I'm loading the whole file in a byte aray before asking stb_vorbis to decompress it in the sample buffer.
so if your shoot.ogg file works on desktop, that can means only two thing.
1) for some weird reason, the file is not loaded correctly, so stb_vorbis fails to decompress it
2) std_vorbis.c is not compiled correctly on android.
could you attach the file in this thread so I can test/debug what's going on here.
lydesik
I got the Xoom charged and tried the build again. The sounds do play, so that part is comfirmed. But I fire too many at once and that does crash the game. Anyway, one thing a time, we can sort that part out later.
https://forum.orx-project.org/uploads/legacy/fbfiles/files/shoot.zip
I'll check how the demo triggers the samples and do the same.
For those who want to see what I have ended up doing to keep android happy:
And instead of doing this in an event:
do this instead:
Thank you, lydesik for helping me think this problem through.
Not sure if these issues are bugs, ie too many orxSound_Play()'s crashing android and stereo samples crashing android, but at least I can call this thread solved.
I'll create an assign myself the issues, (don't know when I'll be able to fix them)