 
   parse: ->
     startTime = process.hrtime()
+    @tree = { boxes: [] }
     while @bits.has_more_data()
       box = Box.parse @bits, null  # null == root box
       process.stdout.write box.dump 0, 1
+      @tree.boxes.push box.getTree()
     diffTime = process.hrtime startTime
     console.log "took #{(diffTime[0] * 1e9 + diffTime[1]) / 1000000} ms to parse"
     console.log "EOF"

    ).join(',') + ' pps=' + @pictureParameterSets.map((pps) ->
      "0x#{pps.toString 'hex'}"
    ).join(',')

# esds
class ESDBox extends Box

  getDetails: (detailLevel) ->
    "audioSpecificConfig=0x#{@decoderConfigDescriptor.decoderSpecificInfo.specificInfo.toString 'hex'} maxBitrate=#{@decoderConfigDescriptor.maxBitrate} avgBitrate=#{@decoderConfigDescriptor.avgBitrate}"

  getTree: ->
    obj = super
    obj.audioSpecificConfig = [@decoderConfigDescriptor.decoderSpecificInfo.specificInfo...]
    obj.maxBitrate = @decoderConfigDescriptor.maxBitrate
    obj.avgBitrate = @decoderConfigDescriptor.avgBitrate
    return obj

# mp4a
# Defined in ISO 14496-14
class MP4AudioSampleEntry extends AudioSampleEntry
