INNER CODE UNIT · Python

put_in_audio_queue

shakedzy/companion · companion.py:138

def put_in_audio_queue(filename: str) -> bool:
    """
    Helper function to put filename in audio queue

    :param filename: filename to put in queue
    """
    global audio_queue_reject_remaining_fragments
    if audio_queue_reject_remaining_fragments:
        fragment_index = int(filename.split('_')[-1].split('.')[0])
        if fragment_index > 0:
            return False
        else:
            audio_queue_reject_remaining_fragments = False
    app_cache.play_recordings_queue.put(filename)
    return True


@app.route('/upload_recording', methods=['POST'])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…