Skip to content

Commit

Permalink
fix: clean up console output
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderpoot committed Jul 17, 2024
1 parent b754bc6 commit 4dac765
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions audio-censor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def transcribe_audio_with_timestamps(audio_segment, model_path, verbose=False):
if "result" in result:
words.extend(result["result"])

print(f'Tx:{words}')
return transcript.strip(), words

# Function to find bad words and their timestamps in the transcribed text
Expand Down Expand Up @@ -234,16 +233,18 @@ def main(**kwargs):
audio_segment = rearrange_audio_segments(audio_segment, words, new_transcript, verbose)
# Retranscribe the rearranged audio to get new timestamps
transcript, words = transcribe_audio_with_timestamps(audio_segment, model_path, verbose=False)
print("New Transcript:", transcript) # Debug
if not transcript_json_path:
print("New Transcript:", transcript) # Debug
if verbose:
print("New Words with timestamps:", words) # Debug
except Exception as e:
print(f"Error rearranging audio: {e}")
return

if nocensor:
print("Transcript Without Censoring:")
print(transcript)
if not transcript_json_path:
print("Transcript Without Censoring:")
print(transcript)
# Generate output file name
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
input_file_name, _ = os.path.splitext(os.path.basename(audio_file))
Expand Down

0 comments on commit 4dac765

Please sign in to comment.