的Soundpool或媒体播放器?媒体播放器、Soundpool

2023-09-06 08:44:09 作者:好听的女生长:老板╮给姐来半斤帅哥

我在做一个卡片游戏为Android,我想那每次一卡扔了,打抛声音。它是同一个文件。我也有其他声音播放喜欢的背景音乐,和某些点击。 你有什么建议来使用,声音池或创建的MediaPlayback和玩什么呢?什么是优势/ disdvantage到每一个?我应该使用OGG或者MP3 / WAV文件? 任何帮助,这是AP preciated。 谢谢

I am doing a cards game for android and I want that everytime a card is thrown, to play throwing sound. It is the same file. I will have also other sounds playing like background music , and certain clicks. What do you recommend to use, sound pool or create MediaPlayback and play it? What would be the advantage/disdvantage to each one? should I use ogg or mp3/wave file? Any help in this is appreciated. Thank you

推荐答案

我会用声音池短片。我可能是错的,但声音池具有更小的开销,再加上它的播放短片的正确方法,它也允许你指定每秒多少次说,声音片段可以播放这有助于较慢的手机。

I would use the sound pool for short clips. I might be wrong but the sound pool has a smaller overhead plus it's the correct way to play short clips, it also allows you to specify how many times per second said sound clip can play which helps slower phones.

至于VS OGG我用MP3的MP3。我不相信有任何性能问题。奥格是免费的执照,但并没有真正与问候你的应用程序重要。再加上它可能会帮助,如果你打算使用这些片段在不播放OGG文件的另一个平台。没有提及的名字:P

With regards to the mp3 vs ogg I use mp3. I don't believe there is any performance issues. Ogg is licence free but that doesn't really matter with regards to your app. Plus it might help if you plan on using these clips on another platform that doesn't play ogg files. No names mentioned :P

 
精彩推荐
图片推荐