ap4y / OrigamiEngine

Lightweight audio engine for iOS and OSX with flac, cue, mp3, m4a, m3u support.
http://ap4y.github.com/OrigamiEngine/
MIT License
545 stars 117 forks source link

Two engines : no sound at all #50

Open rperney opened 9 years ago

rperney commented 9 years ago

Hi,

I was trying to implement a cross-fade transition between two audio files. My guess was to instanciate two engines, then fade out the first one to a volume 0, while the second one is fading in to the maximum volume.

But my engines are mutually locked. What would be the best approach on this one? Regards

ap4y commented 9 years ago

Hi @rperney, I don't think there is a good solution for the cross-fading with this library at the moment. I wouldn't recommend implementing it on top of 2 engine instances. In theory it should work, but feels like an overkill, since engine supports continues playback. I think it would be better to implemented it on top of the output node, but it doesn't have information about how much time left for the current track (should be possible to add), so it won't be possible to implement fade out. I keen to do something about it, but I'm a bit busy this week (possibly next too). Once I have some time I will try to something about it. If you want to try to do it yourself, let me know how I can help you.

If you still want to solve it using 2 instances, I would like to ask you to send me minimal code of what is not working, I will try to debug it.

rperney commented 9 years ago

Hi Arthur, thanks for your answer. My approach with two engines was just an idea, and would not require big changes in the lib, whereas digging into the output node seems more complicated to me.

The bug was a deadlock on the origami lock queue, on a dispatch_sync line

Regards,