Here's how I would do it in bgt.
obj@[]objs(0);//The array of items.
class obj
{
int x,y,loop;
obj(int ox, int oy)
{
x=ox;
y=oy;
loop=p.play_2d("loop.ogg",me.x,x,y,false);//I don't remember the code to make it play on a slot, I can look later.
}
}
void objloop()
{
for(int i=0; i<objs.length; i++)
{
p.update_sound_2d(loop,objs[i].x,objs[i].y);
}
}
void spawnobjj(int x, int y)
{
//spawn code, don't remember it. Basically take the values given to the void and send it to the class, then add it to the objs array.
}