Пример #1
0
def test_get_audio_set():
    from utilities.utilities import Utilities
    u = Utilities()
    expected = {'a.wav', 'b.wav', 'c.wav'}
    data = ['a.wav', 'foo.txt', 'c.txt', 'b.wav', 'c.wav', 'a.txt', 'b.txt']
    result = u.get_audio_set(data)
    assert result == expected
    dia = False
    punct = False
    c = None
    if only_transcribe:
        dia = input('Add Diarization Y/N ')
        if dia.lower() == 'y':
            c = input('How many speakers (int) ')
            configuration.set_diarizationSpeakerCount(int(c))
            configuration.set_enableSpeakerDiarization(bool(dia))
        else:
            print('No diarization')
        punct = input('Add Punctuation Y/N? ')
        if punct.lower() == 'y':
            configuration.set_enableAutomaticPunctuation(True)

    audio_set = utilities.get_audio_set(final_file_list)
    logger.debug(f'AUDIO SET: {audio_set}')
    audio_list = list()
    if limit:
        count = 0
        while count < limit:
            audio_list.append(audio_set.pop())
            count+=1
        string = f'Limit to {limit} audio files'
        print(string)
        logger.debug(string)
    else:
        audio_list = list(audio_set)

    # Prompt for confirmation
    for item in audio_list: