Skip to content

Conversation

@NicolasHug
Copy link
Contributor

@NicolasHug NicolasHug commented Mar 20, 2025

This PR adds most docs for audio decoding, but more will come (like the metadata rendering stuff). This PR needs both #584 and #586 to be merged first.

Docs currently look like this:

Screenshot 2025-03-21 at 10-37-10 Decoding audio streams with AudioDecoder — TorchCodec 0 3 0a0 8ed45a7 Documentation

@NicolasHug NicolasHug marked this pull request as draft March 20, 2025 16:33
@NicolasHug NicolasHug changed the title Audio tutorial Add AudioDecoder docs and tutorial Mar 20, 2025
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 20, 2025
@NicolasHug NicolasHug marked this pull request as ready for review March 21, 2025 10:39

duration_seconds = samples.data.shape[1] / samples.sample_rate
print(f"Duration = {int(duration_seconds // 60)}m{int(duration_seconds % 60)}s.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I'm writing this, I feel like we should just set the duration_seconds field ourselves and make it part of AudioSamples? It's not like memory is a problem, and it would be consistent with video frames.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think it would be useful. I was wondering the same thing when reading the tutorial.

@NicolasHug NicolasHug merged commit 93f5d47 into meta-pytorch:main Mar 21, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants