0
0

This is my first time here so hello everybody :)

I have one simple (i hope) question.. I am trying to create an app (C#) which will play selected part of wav file for me. The thing is I can make this using own Timers etc. etc. etc., but I am wondering – maybe there is such functionality built in FMOD? Or maybe there is some nice piece of advise somebody have for me how to achieve this?

Thanks in advance for any help, and best regards!

Rafal Dunajski

  • You must to post comments
0
0

The problem is the parameters to your setDelay call. Take a look at the documentation for FMOD_DELAYTYPE. FMOD_DELAYTYPE_DSPCLOCK_END actually uses the DSP clock, which is updated at the system output frequency every second. You need to use Channel::getDelay() to find out what time the sound was played, convert your desired play time into DSP clocks, add that to the initial start time, and then pass the result into Channel::setDelay().

  • You must to post comments
0
0

Thanks for your answer!

So.. Yes I do know exactly what time I want to start and stop playing my sound file. I tried to set these properties you told me, but nothing happens, well.. lets say nothing what i expect to happen.

Let me provide you peaces of my C# code I use to achieve this:

[code:174mowcg]FMOD.System system = null;
FMOD.Channel channel1= null;
FMOD.Sound sound1= null;

FMOD.Factory.System_Create(ref system);
system.init(1, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
system.createStream("test.wav", FMOD.MODE.SOFTWARE, ref sound1);
system.playSound(FMOD.CHANNELINDEX.FREE, sound1, true, ref channel1);
channel1.setPosition(10000, TIMEUNIT.MS);
channel1.setDelay(DELAYTYPE.DSPCLOCK_END, 1000, 0);
channel1.setPaused(false);[/code:174mowcg]

Could you tell me what am I doing wrong?

  • You must to post comments
0
0

If you know exactly what pieces of the wave file you want to play, then you can use Channel::setPosition() to set the start time within your sound, and Channel::setDelay() to set the end time.

Hope that helps!

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.