         
         @stream = stream
         
-        @framesPerSec = null
+        @secsPerChunk = null
         @max = null
         @burst = null
                         

    
    bufferedSecs: ->
        # convert buffer length to seconds
        Math.round @buffer.length / @framesPerSec 
        
    #----------
    
    checkOffset: (offset) ->
        # we're passed offset in seconds. we'll convert it to frames
        offset = Math.round Number(offset) * @framesPerSec
        
        console.log "asked about offset of ", offset
        

        
        # -- set up header and frame functions -- #
        
        @dataFunc = (chunk) =>
            # if we're at max length, shift off a chunk (or more, if needed)
            while @buffer.length > @max
                @buffer.shift()

            # push the chunk on the buffer
            @buffer.push chunk

            # loop through all connected listeners and pass the frame buffer at 
            # their offset.
            bl = @buffer.length
            for l in @listeners
                # we'll give them whatever is at length - offset
                l.writeFrame @buffer[ bl - 1 - l._offset ]
        
        # -- look for stream connections -- #
                
