KEMBAR78
Example for Mu law encoding by harishsdev · Pull Request #1586 · pytorch/audio · GitHub
Skip to content

Conversation

@harishsdev
Copy link
Contributor

Example for Mu law encoding

@harishsdev
Copy link
Contributor Author

PR for Issue #1564

@harishsdev
Copy link
Contributor Author

@mthrok please help to review

Copy link
Contributor

@mthrok mthrok left a comment

Choose a reason for hiding this comment

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

Same as #1566. Also please do not open other PR until #1586 and #1566 are fixed.

  1. Please fix the indentation. Please check the resulting doc.
  2. Please assign the transform into intermediate variable. (no one-liner)
  3. Please use something more descriptive than trans as variable name.

@harishsdev
Copy link
Contributor Author

@nateanl please help to review

Copy link
Member

@nateanl nateanl left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the change @harishsdev. We can merge it after fixing all nits!

Example
>>> waveform, sample_rate = torchaudio.load('test.wav', normalization=True)
Copy link
Member

Choose a reason for hiding this comment

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

nit: normalization is changed to normalize now. Let's replace it.

Suggested change
>>> waveform, sample_rate = torchaudio.load('test.wav', normalization=True)
>>> waveform, sample_rate = torchaudio.load('test.wav', normalize=True)

Example
>>> waveform, sample_rate = torchaudio.load('test.wav', normalization=True)
>>> transform = torchaudio.transforms.MuLawEncoding(quantization_channels = 512)
Copy link
Member

Choose a reason for hiding this comment

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

nit: remove spaces.

Suggested change
>>> transform = torchaudio.transforms.MuLawEncoding(quantization_channels = 512)
>>> transform = torchaudio.transforms.MuLawEncoding(quantization_channels=512)

quantization_channels (int, optional): Number of channels. (Default: ``256``)
Example
Copy link
Member

@nateanl nateanl Aug 4, 2021

Choose a reason for hiding this comment

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

We can delete the line break to be consistent with other examples.

Suggested change

@harishsdev harishsdev requested a review from nateanl August 4, 2021 05:23
@nateanl nateanl merged commit 48b23c1 into pytorch:main Aug 4, 2021
@nateanl
Copy link
Member

nateanl commented Aug 4, 2021

Thanks! I have merged it to main branch.

@harishsdev
Copy link
Contributor Author

@nateanl thanks for merging it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants