File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1205,7 +1205,11 @@ async fn process_command_with_opus(
12051205 ws. send ( Message :: binary ( start_audio) ) . await ?;
12061206 }
12071207 WsCommand :: Audio ( data) => {
1208- log:: trace!( "Audio chunk size: {}" , data. len( ) ) ;
1208+ log:: trace!(
1209+ "Audio chunk size: {}, ret_audio size: {}" ,
1210+ data. len( ) ,
1211+ ret_audio. len( )
1212+ ) ;
12091213 for chunk in data. chunks_exact ( 2 ) {
12101214 let sample = i16:: from_le_bytes ( [ chunk[ 0 ] , chunk[ 1 ] ] ) ;
12111215 ret_audio. push ( sample) ;
@@ -1224,6 +1228,8 @@ async fn process_command_with_opus(
12241228 . expect ( "Failed to serialize AudioChunk ServerEvent" ) ;
12251229 ws. send ( Message :: binary ( audio_chunk) ) . await ?;
12261230 }
1231+
1232+ ret_audio. clear ( ) ;
12271233 }
12281234 WsCommand :: EndAudio => {
12291235 log:: trace!( "EndAudio" ) ;
You can’t perform that action at this time.
0 commit comments