fix: encode to a new vec instead of an empty one when rendering, log more stuff for debugging
This commit is contained in:
@@ -66,13 +66,16 @@ impl RenderManager {
|
||||
(),
|
||||
Infallible, // TODO: a real error type
|
||||
> {
|
||||
let mut bytes = Vec::new();
|
||||
|
||||
let mut encoder =
|
||||
opus2::Encoder::new(sample_rate, channels, Application::Audio).expect("TODO");
|
||||
|
||||
let encode_result = encoder.encode(&samples, &mut bytes);
|
||||
tracing::info!(?encode_result);
|
||||
const MAX_SIZE: usize = usize::MAX / 4;
|
||||
let encode_result = encoder.encode_vec(&samples, MAX_SIZE);
|
||||
if let Err(error) = &encode_result {
|
||||
tracing::error!(?error);
|
||||
} else {
|
||||
tracing::info!("encode ok");
|
||||
}
|
||||
encode_result.expect("TODO");
|
||||
|
||||
let path = render.to_string();
|
||||
|
||||
Reference in New Issue
Block a user