You're developing a realtime application, and don't know how to add values to elements of an array?????
Pull my other leg: it'll play a tune for you.
What is the criterion by which you would describe a method as "best"? If you are truly designing a realtime application, you will realise the significance of that question.