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

Request: Please add examples #15

Open
saant03 opened this issue Aug 8, 2021 · 5 comments
Open

Request: Please add examples #15

saant03 opened this issue Aug 8, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@saant03
Copy link

saant03 commented Aug 8, 2021

Hi, thank you for creating this crate. I have been trying to get encoding working with Rust without success. It would be great if there are some examples to get feel for the API. Tx

@Lakelezz
Copy link
Owner

Hello, I agree, examples should be added. I will look into this for the 0.3-release.

However in the meantime, if you want to use 0.2, I recommend you to take a look at songbird: https://github.com/serenity-rs/songbird/search?p=1&q=audiopus

The 0.3 RC is mostly a different API, you can see the potential differences for songbird in this fork here: adumbidiot/songbird@9fae49e due to the problem of serenity-rs/songbird#80.

@Lakelezz Lakelezz added the enhancement New feature or request label Aug 17, 2021
@saant03
Copy link
Author

saant03 commented Aug 18, 2021

Amazing! Thank you

@numfin
Copy link

numfin commented Sep 26, 2021

@Lakelezz hi! First of of all thank you for this project!
I want to create my own voice chat. I started with reading audio input from my microphone and sending it to my headphones. Now i want to send this audio through internet. I know that skype, teamspeak and discord using opus, but its not a Rust library. So i found rust-rs crate. Encoded my &[f32] to &[u8], got some data, and tried to Decode this data. And.... Opus(BadArgument). The documentantion without examples and only with types was very difficult for me.

Chapter2 (:D sorry)

This time i found your repository (crate). And types in your library are a lot more readable (thank you for awesome project!). But... Always but... I dont understand what opus wants from me. I'm encoding [f32] then trying to decode the same info. Fail.
Could you pleeeeease <3 provide an example of full usage? I tried to look at songbird repo, but this repo is too big and difficult to figure out whats going on.

and some pictures so it easier to understand what im trying to do
image
image

Me (noobie noobie) will be forever thankfull for you :3

@zezic
Copy link

zezic commented Nov 6, 2022

It seems like Opus require encoded/decoded audio frame length to match some supported values:
https://www.opus-codec.org/docs/html_api/group__opusencoder.html#gace941e4ef26ed844879fde342ffbe546
https://www.opus-codec.org/docs/html_api/group__opusdecoder.html#ga53b7fd5621613c4d7fcc17000ff1c9ec

@rumblefrog
Copy link

rumblefrog commented May 18, 2023

Hi, are there any examples of Repacketizer? I'm not if the library wrapping is correct on some parts, most notably Repacketizer.

Repacketizer::repacketizer_out_range has an empty return value, whereas opus_repacketizer_out() returns the size of the output packet on success.

I'm also unsure how I'm meant to pass a valid output buffer to repacketizer_out_range either, try_into from a mutable Vec runs into the error of Error::EmptyPacket, does the buffer needs to be pre-populated prior to passing?

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

No branches or pull requests

5 participants