0
0

If I create a sound from an Impulse Tracker file with mode
[code:khc96vut]
FMOD_CREATESTREAM | FMOD_HARDWARE | FMOD_LOOP_NORMAL | FMOD_2D
[/code:khc96vut]
I’m able to set the offset by calling
[code:khc96vut]
FMOD::Channel::setPosition(offset, FMOD_TIMEUNIT_MODORDER)
[/code:khc96vut]
for the FMOD channel that’s playing the tracker sound, and I’m able to set
channel volumes by
[code:khc96vut]
FMOD::Sound::setMusicChannelVolume()
[/code:khc96vut]
and everything works fine.

But, if I create the sound as a sample with mode
[code:khc96vut]
FMOD_CREATESAMPLE | FMOD_HARDWARE | FMOD_LOOP_NORMAL | FMOD_2D
[/code:khc96vut]
playing the tracker music fails. FMOD seems to be playing the music on one
of it’s channels, but either no sound is output, or wrong music is played
(apparently from wrong offset). Setting the offset has no effect.

Any ideas of what might be the problem?

  • You must to post comments
0
0

[quote="brett":3m8bvq06]FMOD_CREATESAMPLE means decompress into PCM data. If you try to decompress a .it file into memory it will run out of memory because it is endless. You can actually get this to work with FMOD_ACCURATETIME so it can calculate a time but if you have a file with multiple segments of music in it it will probably only decompress the first intro track into memory and ignore the rest.[/quote:3m8bvq06]

Thanks for the answer, this explains the behavior perfectly. :)

[quote="brett":3m8bvq06]Anyway – the correct way to load and play a mod is with createStream.[/quote:3m8bvq06]

Yes, that works nicely. The reason I tried out alternatives was the CPU time usage on iOS. In our case, about 20%, most of it from streaming (as reported by FMOD). Is there some way to optimize the CPU usage? 20% is probably too much for us.

[quote="brett":3m8bvq06]You should check your error codes – i’m sure you would have seen FMOD_ERR_MEMORY from createSound. This is just in response to saying it was silent or functions werent responding. It would have been returning errors all over the place :)[/quote:3m8bvq06]

😳 Actually, I did check the error code from createSound(), but not from Channel::setPosition(), which was returning FMOD_ERR_FORMAT.

  • You must to post comments
0
0

FMOD_CREATESAMPLE means decompress into PCM data. If you try to decompress a .it file into memory it will run out of memory because it is endless. You can actually get this to work with FMOD_ACCURATETIME so it can calculate a time but if you have a file with multiple segments of music in it it will probably only decompress the first intro track into memory and ignore the rest.

Anyway – the correct way to load and play a mod is with createStream. It is not streaming from disk if that’s what you think (the .it data is still fullly loaded into memory) – it just streams the pattern data I guess you could say – as it plays.

You should check your error codes – i’m sure you would have seen FMOD_ERR_MEMORY from createSound. This is just in response to saying it was silent or functions werent responding. It would have been returning errors all over the place :)

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.