I suspect you shouldn't derive variable type from the DirAccess assignment. Try:
var my_file = DirAccess.open("res://sound/")
instead of:
var my_file := DirAccess.open("res://sound/")
Also, what's the current scope there? What class are you extending?