0
0

How I can play OGG sound from memory and do not decompress it completely?

[quote:lce33p8q]
FMOD_CREATECOMPRESSEDSAMPLE

Load MP2, MP3, IMAADPCM or XMA into memory and leave it compressed. During playback the FMOD software mixer will decode it in realtime as a ‘compressed sample’. Can only be used in combination with FMOD_SOFTWARE. Overrides FMOD_CREATESAMPLE. If the sound data is not ADPCM, MPEG or XMA it will behave as if it was created with FMOD_CREATESAMPLE and decode the sound into PCM.
[/quote:lce33p8q]

Now I tried
[code:lce33p8q]
bool loop;
std::vector<char> data;

        .....         

        FMOD_CREATESOUNDEXINFO fmod_createinfo = { sizeof(FMOD_CREATESOUNDEXINFO) };
        fmod_createinfo.length = data.size();

        FMOD_RESULT fmod_res = fmod_system-&gt;createSound(
            &amp;*data.begin(),
            FMOD_IGNORETAGS | FMOD_SOFTWARE | FMOD_LOOP_NORMAL*loop | FMOD_CREATECOMPRESSEDSAMPLE | FMOD_OPENMEMORY, 
            &amp;fmod_createinfo, &amp;m_sound);

[/code:lce33p8q]

and it completely decompress OGG sound from 3Mb to 30Mb (according to documentation, [i:lce33p8q]"Load MP2, MP3, IMAADPCM or XMA …"[/i:lce33p8q])

  • You must to post comments
0
0

[quote="Winnie":3h43eokf]How I can play OGG sound from memory and do not decompress it completely?

[quote:3h43eokf]
FMOD_CREATECOMPRESSEDSAMPLE

[/quote:3h43eokf][/quote:3h43eokf]

I have replaced FMOD_CREATECOMPRESSEDSAMPLE by the FMOD_CREATESTREAM flag and it works.

If this was not an OGG-sound, but MP2, what difference between FMOD_CREATESTREAM | FMOD_OPENMEMORY and FMOD_CREATECOMPRESSEDSAMPLE | FMOD_OPENMEMORY ? Or it is important only for streaming from file?

  • You must to post comments
0
0

It says what it means in the comments that you quoted? stream streams the data from the file at runtime, createcompressedsample loads only certain formats into memory and decodes them directly inside the fmod software mixer.

Just use createStream for ogg files.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.