street-lab-tech / street-whisper-app

STREET Lab Whisper App - a tool that transcribes and translates audio files into CSV files.
MIT License
2 stars 0 forks source link

PR #1: CSV naming convention changes + fixing audio file checks #6

Closed carmen-chau closed 4 months ago

carmen-chau commented 5 months ago

PR fix for issues: #7, #13

Here are a list of changes to the PR:

1. Changing CSV file name to follow the naming convention:

file_name_transcription_time.csv

OR

file_name_translation_time.csv

depending on selected choice.

NOTE: There is a bug with the naming, see comments below.

NOTE 2: Will re-add renaming for the dual transcription + translation features once PR #11 has been reviewed or feedback provided.

2. Expanding audio file metadata checks

All file extensions as listed in issue #7 should be implemented in method validate_audio_file.

moonsdust commented 4 months ago

We should consider more audio file types

carmen-chau commented 4 months ago

We should consider more audio file types

Yep I'm working on that. FYI we can really only add the audio file type checks based on what file types Whisper supports

carmen-chau commented 4 months ago

@moonsdust I made changes to the file naming. So now the backslash shouldn't appear in between the time digits (with regards to the final file name).

Current file naming convention is: audio_transcription1133.csv. There is no ":" due to a bug (see below)

One weird bug though that I cannot seem to understand, is that when you add a ":" to seperate the hour digits from the minute digits, the backslash appears instead.

Ie: If I tried coding up the file naming formatting to be: audio_transcription11:33.csv, it formats it to be audio_transcription11\33.csv.

Would appreciate if you could let me know if this happens on your end too

moonsdust commented 4 months ago

@moonsdust I made changes to the file naming. So now the backslash shouldn't appear in between the time digits (with regards to the final file name).

Current file naming convention is: audio_transcription1133.csv. There is no ":" due to a bug (see below)

One weird bug though that I cannot seem to understand, is that when you add a ":" to seperate the hour digits from the minute digits, the backslash appears instead.

Ie: If I tried coding up the file naming formatting to be: audio_transcription11:33.csv, it formats it to be audio_transcription11\33.csv.

Would appreciate if you could let me know if this happens on your end too

You can't include ":" in file names on MacOS. That's why it changes ":" to "\". @carmen-chau

carmen-chau commented 4 months ago

@moonsdust I made changes to the file naming. So now the backslash shouldn't appear in between the time digits (with regards to the final file name). Current file naming convention is: audio_transcription1133.csv. There is no ":" due to a bug (see below) One weird bug though that I cannot seem to understand, is that when you add a ":" to seperate the hour digits from the minute digits, the backslash appears instead. Ie: If I tried coding up the file naming formatting to be: audio_transcription11:33.csv, it formats it to be audio_transcription11\33.csv. Would appreciate if you could let me know if this happens on your end too

You can't include ":" in file names on MacOS. That's why it changes ":" to "\". @carmen-chau

I did not know that! I tried putting an underscore and it works. I hope that change is ok to you.

At the moment the file names are inching on the longer side... I think that's another improvement to this CLI we can work on in the future.

carmen-chau commented 4 months ago

@moonsdust. The reason why the .mp4 file you suggested didn't work is because.... it wasn't actually a .mp4 file (using python magic library reveals it is actually a ADTS file).

Repull this PR again, and try again using the same spanish .mp4 file. It should work now.

Note: I can also confirm that the .m4a spanish file works fine

This is an interesting edge case worth noting in the documentation (ie: Some audio files are disguised as .mp4 or other extensions when in reality, they are ADTS files)