Skip to content

Add simulate_rir_ism method for room impulse response simulation #2880

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

Closed
wants to merge 14 commits into from

Conversation

nateanl
Copy link
Member

@nateanl nateanl commented Nov 30, 2022

replicate of #2644

@facebook-github-bot
Copy link
Contributor

@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@nateanl nateanl force-pushed the rir_ism branch 2 times, most recently from 7b5a3c1 to 15763cc Compare December 5, 2022 21:28
@nateanl nateanl marked this pull request as ready for review December 5, 2022 21:37
@facebook-github-bot
Copy link
Contributor

@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

if e_abs.shape[0] > 1:
if center_frequency is None:
center = torch.tensor(
[125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0], dtype=room.dtype, device=room.device
Copy link
Contributor

Choose a reason for hiding this comment

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

where do these values come from? should they be generated programmatically or made customizable?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is mentioned in the note of docstring.

Copy link
Contributor

@fakufaku fakufaku left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me. I have left a few comments about docstrings, and also a suggestion to not support 2D rooms.

@nateanl nateanl force-pushed the rir_ism branch 2 times, most recently from a2e3285 to b0e2061 Compare February 10, 2023 16:53
@facebook-github-bot
Copy link
Contributor

@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Comment on lines 79 to 82
_load_lib("libtorchaudio")

import torchaudio.lib._torchaudio # noqa

Copy link
Collaborator

Choose a reason for hiding this comment

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

This part is now repeated multiple times, which is redundant. Can you merge the initialization logics around extension, kaldi, RIR as follow?

_IS_RIR_AVAILABLE = False
_IS_KALDI_AVAILABLE = False
_IS_TORCHAUDIO_EXT_AVAILABLE = is_module_available("torchaudio.lib._torchaudio")
if _IS_TORCHAUDIO_EXT_AVAILABLE:
    _load_lib("libtorchaudio")

    import torchaudio.lib._torchaudio # noqa

    _check_cuda_version()

    _IS_RIR_AVAILABLE = torchaudio.lib._torchaudio.is_rir_available()
    _IS_KALDI_AVAILABLE = torchaudio.lib._torchaudio.is_kaldi_available()


} // Anonymous namespace

TORCH_LIBRARY_IMPL(torchaudio, CPU, m) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you put TORCH_LIBRARY_IMPL and TORCH_LIBRARY_FRAGMENT in anonymous namespace as well?

@facebook-github-bot
Copy link
Contributor

@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@nateanl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@nateanl merged this pull request in 8c5c9a9.

@github-actions
Copy link

Hey @nateanl.
You merged this PR, but labels were not properly added. Please add a primary and secondary label (See https://github.com/pytorch/audio/blob/main/.github/process_commit.py)

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.

5 participants