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

Add a button to record new samples #77

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

FeliksWeber
Copy link
Collaborator

@FeliksWeber FeliksWeber commented Jun 16, 2022

Fixes #72

Todo:

  • Update sample list after recording
  • Ability to choose capture device
  • Decide on a naming scheme
  • Documentation
  • Test on Windows

Future work:

  • Recognize devices connected on runtime
  • Translations

@FeliksWeber FeliksWeber added the enhancement New feature or request label Jun 16, 2022
@FeliksWeber FeliksWeber marked this pull request as ready for review June 17, 2022 08:11
@FeliksWeber FeliksWeber requested a review from AndreasGocht June 17, 2022 09:05
Copy link
Collaborator

@AndreasGocht AndreasGocht left a comment

Choose a reason for hiding this comment

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

I made a few suggestions for changes.

Best,

Andreas

self.session.setRecorder(self.recorder)
self.recorder.setMediaFormat(QMediaFormat.Wave)
self.recorder.setEncodingMode(QMediaRecorder.ConstantBitRateEncoding)
self.recorder.setAudioSampleRate(16000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose to record and save in full quality, e.g. 48000 kHz, and then reduce the sample rate later for training and inference

self.recorder.setMediaFormat(QMediaFormat.Wave)
self.recorder.setEncodingMode(QMediaRecorder.ConstantBitRateEncoding)
self.recorder.setAudioSampleRate(16000)
self.recorder.setAudioBitRate(32)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think 16 Bit is the standard here, but I am unsure.

if not self.project.audio_folder or not self.project.audio_folder.is_dir():
return
if self.recorder.recorderState() == QMediaRecorder.StoppedState:
name = "000" + "".join(random.choices("0123456789abcdef", k=125))
Copy link
Collaborator

Choose a reason for hiding this comment

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

random is difficult, as it might happen at random, that the same value is chosen, which might lead to bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow recording samples
2 participants