Skip to content

Commit

Permalink
add continue function
Browse files Browse the repository at this point in the history
  • Loading branch information
jukaradayi committed Apr 18, 2018
1 parent e8ad060 commit ef849c0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fineDi/diarization_refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,26 @@ def index():
- upload one wav + transcription
"""
wav_list = get_wav_list(os.path.join(app.root_path, 'static', 'audio'))
# ##TODO Ask user if they want to continue where they stopped,
# or treat all the files in the folder.
output = create_segments()

return render_template('index.html', wav=output)

def continue():
""" If the user chose to continue, we look at the .lock files
to check which files were already treated
"""
wav_list = get_wav_list(os.path.join(app.root_path,
app.config['MEDIA_ROOT']))
locks = os.listdir(os.path.join(app.root_path,
app.config['MEDIA_ROOT'])
# remove first dot and .lock, to match names with wav
locks = [fin[1:-5] for fin in locks if fin.endswith('lock')]

first_wav = []
return redirect(url_for('treat_all_wavs'))

#@app.route('/creating')
def create_segments():
""" Take each wav, retrieve all the annotated segments,
Expand Down

0 comments on commit ef849c0

Please sign in to comment.