Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#4: Updating slicer.py for customize start and end time input params #37

Merged
merged 4 commits into from
Oct 1, 2023

Conversation

heymanpreet
Copy link
Contributor

Below improvements added to slicer.py:

  1. The script now takes 3 parameters namely path of audio file, start time and end time for slicing. Pls note that audio start and end times params currently support input in 2 formats, either minutes and seconds or minutes only.

Mins and secs Example: python interviewkit/slicer.py data/Martine+Barrat_FINAL.mp3 105:40 107:40 (audio will be sliced from 105mins 40secs to 107mins and 40secs)
Mins Example: python interviewkit/slicer.py data/Martine+Barrat_FINAL.mp3 2 4 (audio will be sliced from 2mins to 4mins)

  1. Added more checks for input parameters
  2. Code refactoring and improvements

@audreyfeldroy Issue No. 4 mentions audio slice from 105:40 to 107:40 of MartineBarrat_FINAL.mp3. I am afraid that the downloaded MartineBarrat_FINAL audio only contains ~90mins of sound, so I was not able to create the sliced audio file from 105:40 to 107:40 as required.

For creating sliced audio from any file, just mention the mins and seconds for start and end time and the script will generate the sliced audio file.
Example: If we need sliced audio from 10mins 20secs to 20mins 40 secs, it can be done as shown below:
python interviewkit/slicer.py data/Martine+Barrat_FINAL.mp3 10:20 20:40

Also, The Script currently doesn't support input in hours format, so hours will need to converted to mins:secs format. I am planning to add hours support to the script in coming days. For now, the start and end time needs to be converted to mins:secs format.
Eg: If we want audio from 1hr 20mins 30 secs to 1hr 30mins 40secs, it can be done as shown below:
1hr 20mins 30 secs = 80mins 30secs
1hr 30mins 40sec = 90mins 40secs

python interviewkit/slicer.py data/Martine+Barrat_FINAL.mp3 80:30 90:40

For Issue#35 regarding slicer support for m4a files, I tested the current slicer script on SusanYung_FINAL.m4a file and it worked perfectly fine without issues. So I guess that issue can be closed if it works on your side too without issues.

…, added checks and code refactoring.

1. Slicer.py can take 3 arguments now and start and end time can be added in mins:secs format.
2. Added more checks for input params
3. Code Refactoring
Copy link
Member

@audreyfeldroy audreyfeldroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting this together! It works well.

@audreyfeldroy audreyfeldroy merged commit dbf8e92 into crisishistory:main Oct 1, 2023
1 check passed
@heymanpreet heymanpreet mentioned this pull request Oct 4, 2023
1 task
@audreyfeldroy audreyfeldroy added the hacktoberfest-accepted Issue or PR is approved for anyone who wants it to count toward Hacktoberfest label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Issue or PR is approved for anyone who wants it to count toward Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants