PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Hekkus. Load audio on iPhone.

tinybulb.com · 26 Mar 2009, 10:14 UTC
Hi,

Is there any nice way to load audio for Hekkus on iPhone from READONLY path? Right now I do the following to load the sound:

if(E_OK == ecd.snd->Open()) {
ecd.file->Open("aurora.mod", EFOF_READONLYPATH);

int size = ecd.file->Size();
char* data = new char[size];
ecd.file->Read(data, size);
ecd.snd->LoadMusic(0, data, size);

ecd.file->Close();
}
Hi,

You can also use the read-only path from the ecd.dat structure, for example:

Code:

char filename[MAX_ESTR];
ClassEStd::StrCpy(filename, ecd.dat->readonlypath);
ClassEStd::StrCat(filename, "aurora.mod");
tinybulb.com · 16 Apr 2009, 11:58 UTC
Is there any additional checks for audio format in LoadSoundEffect method? Latest Hekkus library supports OGG, but when i trying to load it through EDGE it is returns error E_ERROR. Is there any additional ways to debug to check why it is not load it? Loading of mod and wav works perfectly. You can find code sample from my game below:

Code:
ClassEStd::StrCpy(filename, ecd.dat->readonlypath);
ClassEStd::StrCat(filename, "music1.mod");
int errCode = ecd.snd->LoadMusic(0, filename); [b]//works[/b]
printf("%i\n", err);

ClassEStd::StrCpy(filename, ecd.dat->readonlypath);
ClassEStd::StrCat(filename, "effect1.ogg");
errCode = ecd.snd->LoadSoundEffect(0, filename); [b]//do not work[/b]
printf("%i\n", err);

ClassEStd::StrCpy(filename, ecd.dat->readonlypath);
ClassEStd::StrCat(filename, "effect2.wav");
errCode = ecd.snd->LoadSoundEffect(1, filename); [b]//works[/b]
printf("%i\n", err);

I sent this OGG file to Thomas(hekkus developer), he mentioned that it is works ok with his library and playing well. I double-checked includes, included library which supports OGG. Some additional checks in EDGE for audio formats - my last hope... So am I right, there is checks in edge?

With best regards,
Nikita Leonov
Attachments:
effect1.ogg.zip (46 KB)
Hi,

There are no additional checks in EDGELIB, however the audio loading routines may be a bit different. EDGELIB always reads the complete file in memory which may not work with OGG.