Skip to content

Conversation

NicolasHug
Copy link
Contributor

@NicolasHug NicolasHug commented Mar 13, 2025

Towards #549

This PR adds the sample_format field to AudioStreamMetadata. In terms of values, it'll be what av_get_sample_fmt_name() returns, so it's a bit "ffmpeg-like": flt, fltp, s16, s32... Maybe we'll want to expose a more user-friendly string? I'm not sure, either way, we can always re-map as follow-ups.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 13, 2025
)
assert best_audio_stream_metadata.bit_rate == 128837
assert best_audio_stream_metadata.codec == "aac"
assert best_audio_stream_metadata.sample_format == "fltp"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hard-coded value here and below, this test already has lots of these.

# decoded frames.
self._reference_frames[stream_index] = torch.load(
frames_data_path, weights_only=True
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add the corresponding reference frames in #556

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also adding this new asset, not strictly needed for this PR, but still useful to check a format that's not fltp.
It will be needed in #556 anyway. It's from TorchAudio.

@NicolasHug NicolasHug merged commit 8e611bb into meta-pytorch:main Mar 14, 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