Skip to content
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

How to play stream? #7

Open
robertapengelly opened this issue Sep 9, 2022 · 2 comments
Open

How to play stream? #7

robertapengelly opened this issue Sep 9, 2022 · 2 comments

Comments

@robertapengelly
Copy link

robertapengelly commented Sep 9, 2022

I'm not exactly posting an issue but more of an enquiry, how do you play the frames? I've tried using the getPayload function of the frames but all I get is static noise through the speaks. I have noticed that there's a getSamples function so maybe I should be using that instead but I don't know how to turn it into a single byte array.

@hschieck
Copy link

The payload still has to be decoded using the appropriate codec, for example MP3. This decoder only decodes the continuous bytestream into single frames of (still) encoded content. The thing is, that each frame is an independant piece of encoded audio that has to be decoded each for itself, because each frame can be encoded using different parameters. That's why it's important to decode the bytestream into these pieces/frames of encoded content, to get insight into the parameters necessary to decode it successfully into (then) playable audio content like PCM.

@robertapengelly
Copy link
Author

robertapengelly commented Sep 11, 2022

This decoder only decodes the continuous bytestream into single frames of (still) encoded content.

Ohh okay, I didn't realise that it didn't convert the frames to PCM playable bytestreams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants