fix: encode to a new vec instead of an empty one when rendering, log more stuff for debugging
This commit is contained in:
@@ -304,7 +304,6 @@ pub async fn handle(state: State, interaction: Interaction) {
|
||||
.between_in_vc(start, end, guild_id, voice_channel_id);
|
||||
|
||||
while let Some(recording) = recordings.try_next().await.expect("TODO") {
|
||||
tracing::debug!(?recording);
|
||||
let recording_data = state
|
||||
.recording_manager
|
||||
.read(&recording)
|
||||
|
||||
@@ -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