Closed mixage closed 1 year ago
There is definitely a missing repeatCount
in https://github.com/sbooth/SFBAudioEngine/blob/c94313a66d13b24cd3c254628d51294af6ae5b83/Decoders/SFBLoopableRegionDecoder.m#L57
It makes me wonder whether GCC_WARN_UNUSED_PARAMETER
should be enabled.
I'm not sure if the other changes in this PR are required, though.
I think PR #255 contains all the necessary changes.
If you'd like to revert the other changes I'm happy to merge this PR.
I'm not sure to know the right way to do this... Should I push a new commit?
I'm not sure to know the right way to do this... Should I push a new commit?
Yes, you can just push additional commits and they'll be squashed into one when merged.
Once the changes in MainMenu.xib
are reverted this should be ready to go.
Done. (Xcode made these changes just by viewing the .xib)
NB: loop does'nt work after reverting SFBLoopableRegionDecoder.m row 183 to:
if ( _repeatCount && _frameLength == (_framesDecoded / _frameLength))
Any idea? Thanks :)
What is repeat count set to? The intent of that parameter is the number of times to repeat following the initial play through, so playing a region twice implies a repeat count of one. Is that the behavior you're seeing?
The region plays once, regardless of the value of REPEAT_COUNT
NSError *error= nil;
NSURL *url = [NSURL fileURLWithPath:FILE_PATH];
_player = [[SFBAudioPlayer alloc]init];
SFBLoopableRegionDecoder *decoder = [[SFBLoopableRegionDecoder alloc]initWithURL:url framePosition:START_FRAME frameLength:NUM_FRAMES repeatCount:REPEAT_COUNT error:&error];
[_player enqueueDecoder:decoder forImmediatePlayback:YES error:&error];
[_player playReturningError:&error];
I will take a closer look at this later today when I have a bit more time.
Could you verify whether the proposed fix in #255 corrects the problem for you?
Works like a charm :) Thank you!