0
0

Is it possible to use .useropen/read/close/seek with FMOD_STREAM ? I don’t know anything about the audio data on beforehand (its coming from a streaming module) , it could be anything from pcm to ogg compressed data. I want to feed FMOD with this data from useropen/read (and let FMOD "guess" the type on the fly) .Is that possible?

im trying:

[code:btf78hq4]FMOD::Sound* sound = NULL;
FMOD_CREATESOUNDEXINFO exInfo;
// TODO: WINDOWS : ZeroMemory_(&exInfo, sizeof(exInfo));
memset(&exInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exInfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exInfo.useropen = fmodopen;
exInfo.userclose = fmodclose;
exInfo.userread = fmodread;
exInfo.userseek = fmodseek;

FMOD_MODE mode = FMOD_2D | FMOD_HARDWARE | FMOD_CREATESTREAM | FMOD_OPENUSER;

FMOD_RESULT err = m_FMODSystem->createSound(0,
mode,
&exInfo,
&sound );[/code:btf78hq4]
And im getting FMOD_ERR_INVALID_PARAM. Which parameter is missing or wrong here? (should I be using OPENUSER at all? the docs doesnt say)

I can’t find any example use of useropen/read in the docs/examples or the forum (no one’s using it?)

cheers,

  • You must to post comments
0
0

Ok .. managed to get a little further, now soundCreate succeed with:

[code:1o9442j5]FMOD::Sound* sound = NULL;
FMOD_CREATESOUNDEXINFO exInfo;
// TODO: WINDOWS : ZeroMemory_(&exInfo, sizeof(exInfo));
memset(&exInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exInfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exInfo.useropen = fmodopen;
exInfo.userclose = fmodclose;
exInfo.userread = fmodread;
exInfo.userseek = fmodseek;

FMOD_MODE mode = FMOD_2D | FMOD_HARDWARE | FMOD_CREATESTREAM;

FMOD_RESULT err = m_FMODSystem->createSound(myStreamData,
mode,
&exInfo,
&sound );[/code:1o9442j5]

I can’t pass userdata with exInfo.userdata (so I use the filename ptr to pass my streamdata).
Anyway, now I get to the open-callback and I calc the file/streamsize and set the filesize and the userdata* (to my streamData). Then I get a seek-callback with pos = fileSize?. Why is that? it doesnt makes sense, especially not for streaming. Why is FMOD seeking to the end of the file/stream before reading anything?.

  • You must to post comments
0
0

pls! why is FMOD seeking at the end of a stream right in the beginning of a load?. I get a seek callback with pos == filesize or close to the end of the stream right after I open the file/stream (later it jumps/seeks randomly around the file). Im using IGNORE_TAGS as suggested and its a ogg stream. Is there a way to get around this? by returning FMOD_ERR_NOTREADY somewhere? or?

help really appreciated,

thanks :-)

  • You must to post comments
0
0

It is because that’s what ogg vorbis does. If you’re using FMOD_IGNORETAGS Then it is not fmod that is seeking, it is ogg vorbis code looking for data at the end of the ogg. Use a different format if you don’t want it to do this.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.