   util.pump reader, writer, ->
     duration = size / SAMPLE_RATE / NUM_CHANNELS / 2
     winston.info 'File added OK', file: src, duration: duration
-      
+
     json.spritemap[name] = start: offsetCursor, end: offsetCursor + duration, loop: name == argv.autoplay
     offsetCursor += duration
     appendSilence Math.ceil(duration) - duration + 1, dest, cb

          , cb3
        else
          cb3()
        
  , (err) ->
    return winston.error 'Error adding file', err if err
    
    async.forEachSeries Object.keys(formats), (ext, cb) ->
      winston.debug 'Start export', format: ext
      exportFile tempFile, argv.output, ext, formats[ext], true, cb

    cb()

processFiles = ->
  formats =
    aiff: []
    ac3: '-acodec ac3'.split ' '
    mp3: '-ab 128 -f mp3'.split ' '
    m4a: []
    ogg: '-acodec libvorbis -f ogg'.split ' '

  rawparts = if argv.rawparts.length then argv.rawparts.split ',' else null

  i = 0
  async.forEachSeries files, (file, cb) ->
    i++
