0
0

Hi,

I’m working with very big playlists. So I need a solution which is fast and don’t charges the memory when I read Tags. This was my first try:
[code:342klb2g]
FMOD_System_CreateStream(fmod, PAnsiChar(f), FMOD_DEFAULT, nil, l_fmods);
[/code:342klb2g]
Create a stream BUT I don’t free it. Otherwise the function needs very much time. This is fast, but very bad for the memory (~300MB).

So I tried to free the Stream after every read file:
[code:342klb2g]
FMOD_System_CreateStream(fmod, PAnsiChar(f), FMOD_DEFAULT, nil, l_fmods);
...
FMOD_Sound_Release(l_fmods);
[/code:342klb2g]
This is very nice for the memory but hard for my patience because it is very slow compared to the first method.

I need a function which does not create a new stream but I found nothing. Is it possible to make the method fast and memory-safe ?

  • You must to post comments
0
0

Hm, try your second method, but use FMOD_CREATESOUNDEXINFO and suggestedfiletype. Next use FMOD_LOWMEM and FMOD_OPENONLY flags and it should be a lot faster.

  • You must to post comments
0
0

I get the error, a wrong parameter would be given. I am sure it is the ExInfo, but why does this error appear ?
[code:12jpmpui]
var l_fmods : FMOD_SOUND;
ExInfo : FMOD_CREATESOUNDEXINFO;
Mem : TMemoryStream;
begin
ZeroMemory(@ExInfo, SizeOf(FMOD_CREATESOUNDEXINFO));
ExInfo.cbsize := SizeOf(FMOD_CREATESOUNDEXINFO);
Mem := TMemoryStream.Create;
Mem.LoadFromFile(f);
ExInfo.length := Mem.Size;
GetMem(l_fmods, Mem.size);
Mem.ReadBuffer(l_fmods^, Mem.size);
Mem.Free;

Fehler(FMOD_System_CreateStream(fmod, l_fmods, FMOD_LOWMEM and FMOD_OPENONLY, @ExInfo, l_fmods));

Fehler(FMOD_Sound_GetNumTags(l_fmods, numtags, numtagsupdated));
[/code:12jpmpui]

  • You must to post comments
0
0

Try FMOD_LOWMEM [b:3rrtgqcg]or[/b:3rrtgqcg] FMOD_OPENMEMORY.

  • You must to post comments
0
0

[code:21h6ok4p]
Fehler(FMOD_System_CreateStream(fmod, l_fmods, FMOD_LOWMEM or FMOD_OPENMEMORY, @ExInfo, l_fmods));
[/code:21h6ok4p]
Somehing with ExInfo is wrong. Anybody an idea why ?

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.