You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's suppose my application receives stereo (2 channels) packets that contain a total of 960 float samples (3840 bytes in total) each:
opus_packet_get_nb_channels() returns 2, which is correct.
opus_packet_get_nb_frames() returns 1, which is correct because it refers to the Opus frames.
opus_packet_get_samples_per_frame() returns 480, which is wrong because that is the number of audio frames. The Opus frame contains 960 samples.
opus_packet_get_nb_samples() and opus_decoder_get_nb_samples() return 480, which is wrong because that is the number of audio frames. The packet contains 960 samples.
Audio/Opus frame confusion aside, the issue consists in the functions not taking the number of channels into account.
Since changing the behavior is not feasible, I would simply add a short explanation to the documentation.
The text was updated successfully, but these errors were encountered:
Let's suppose my application receives stereo (2 channels) packets that contain a total of 960 float samples (3840 bytes in total) each:
opus_packet_get_nb_channels()
returns 2, which is correct.opus_packet_get_nb_frames()
returns 1, which is correct because it refers to the Opus frames.opus_packet_get_samples_per_frame()
returns 480, which is wrong because that is the number of audio frames. The Opus frame contains 960 samples.opus_packet_get_nb_samples()
andopus_decoder_get_nb_samples()
return 480, which is wrong because that is the number of audio frames. The packet contains 960 samples.Audio/Opus frame confusion aside, the issue consists in the functions not taking the number of channels into account.
Since changing the behavior is not feasible, I would simply add a short explanation to the documentation.
The text was updated successfully, but these errors were encountered: