 
 setMarker = ->
   time = wavesurfer.getCurrentTime()
-  wavesurfer.addRegion(start: time, drag: true, resize: false, data: { type: 'segment_item' }, color: 'rgba(0,0,0,0.5)')
+  wavesurfer.addRegion(start: round100(time), drag: true, resize: false, data: { type: 'segment_item' }, color: 'rgba(0,0,0,0.5)')
   saveRegions()
 
 window.regionsArray = ->

  time = wavesurfer.getCurrentTime()
  # Assume that time is always within a region, since we initialize a region over full audio at start
  splitCandidate = getRegions(time)[0]
  wavesurfer.addRegion { start: splitCandidate.start, end: round10(time), drag: false, resize: false, data: { type: 'segment' } }
  wavesurfer.addRegion { start: round10(time), end: splitCandidate.end, drag: false, resize: false, data: { type: 'segment' } }
  wavesurfer.regions.list[splitCandidate.region_id].remove()
  saveRegions()


  form = document.forms.edit
  regionId = form.dataset.region
  deleteCandidate = wavesurfer.regions.list[regionId]
  if deleteCandidate.data.type == 'segment'
    if deleteCandidate.start == 0
      # set second's start as 0
      wavesurfer.regions.list[regionsArray()[1].region_id].update(start: 0)
    else
      # set prev's end as this end
      replacer = (region for region_id, region of wavesurfer.regions.list when round100(region.end) == round10(deleteCandidate.start))[0]
      wavesurfer.regions.list[replacer.id].update(end: deleteCandidate.end)
  if regionId
    wavesurfer.regions.list[regionId].remove()
    form.reset()
