开发者

If I want to play the same sound 10 times per second, must I have 10 copies of that sound in memory?

I have a sound that needs to get played 10 times per second. The sound is 1 second long. So it does overlap like 10 times. However, as far as I understand the Finch sound library, I would need 10 different instances of a sound in place so that I can play it 10 times at almost the same time.

When I have just one instance, the sound would stop and play from开发者_JAVA技巧 the beginning on every iteration, but not overlap with itself.

How to do that?


In Finch it depends on how many instances of the particular sound you want to play simultaneously. Pass this number to the initWithFile:rounds: initializer of the RevolverSound class and it will allocate the desired number of copies of the sample.


Unlikely. Depends on the sound system/card and the API you're using. Usually it's fire and forget (where fire is load the data stream, tell audio system to play stream X times). To get it to overlap, you'd may need to use multiple channels. I'm not familiar with finch to know how it handles that sort of thing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜