Closed jeffmikels closed 3 years ago
Can you again create an exampel repo? Adding the floats raw should be fine. What is the exception you get? To test if the error is with encoding or recording you could try to convert the floats to s16le by multiplying each float with 2^31-1 and putting the result in an Int16List (If I remember correctly, encoding with ints already worked?). Btw on which platform are you testing?
Thanks for the advice... I determined the error is that I wasn't sending an appropriately sized packet to the encoder. As you have documented, opus needs a specific size frame and I thought the streaming encoder would handle that for me. I was just sending bytes as I got them thinking the streaming encoder would buffer them until it had a full frame.
If I remember right, the stream encoder should do buffring... Maybe I need to do some investigations 😅
I'm using the
audio_recorder_mc
package which gives me audio data from the microphone as 32 bit floats in packets of typeList<dynamic>
.I am creating the opusEncoder like this:
But I keep getting an Exception when the encoder gets data to the stream.
Can you help me clean up this code and tell me what else I'm doing wrong? Do I need to send frames one at a time to the stream encoder or can I just send the raw floats like I'm doing?