-
Notifications
You must be signed in to change notification settings - Fork 119
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
Example using received audio data? #100
Comments
This should be documented somewhere, you're right! Each event contains up to 20ms of mono 16-bit PCM audio from a single user at 48kHZ -- each If you want to make a wave file per user:
If you want to combine them all:
|
wow, thanks! this is incredibly helpful. |
The PCM data *you* receive is in the endianness of your machine; you just
need to be careful saving it to disk (i.e., "RIFF vs "RIFX" determines this
in the WAV header, and I think the `wav` library just handles this for you).
…On Tue, 12 Oct 2021 at 15:07, Miles Frankel ***@***.***> wrote:
wow, thanks! this is incredibly helpful.
re your second bullet, can you elaborate on being careful around
endianness? This PCM data is big-endian, right? i think i saw that implied
somewhere in the discord docs, such as they are.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABT75FLMAWHZP4B6VPB6OBTUGQ6J7ANCNFSM5FZ2U5WQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Ah gotcha. Thanks again, you have saved me hours of struggling with opus and discord documentation. If you want, I could do a quick PR to add basically what you said to the bit of documentation I linked initially. |
Thanks; that would be very helpful if you could do so.
|
I'm hacking on this example (https://github.com/serenity-rs/songbird/blob/current/examples/serenity/voice_receive/src/main.rs), and I can receive and buffer voice audio, but I can't figure out what format it's in or how to use it.
I've got some of these https://serenity-rs.github.io/songbird/current/songbird/events/context_data/struct.VoiceData.html#structfield.audio but what is this? How can I turn this into, say, a .wav file?
I've been banging my head on this one for a couple hours so any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: