DaniilAlpha / minisound

A high-level real-time audio playback library for Flutter, based on miniaudio.
3 stars 1 forks source link

loadSound supposed to work ? #3

Closed Ifilehk closed 11 months ago

Ifilehk commented 1 year ago

Hello!

Having trouble to try this function. When loading a Uint8List of data the app crashes. Any clue ?

INFO:   Built-in Audio Digital Stereo (HDMI) (Playback)
INFO:     Format:      32-bit IEEE Floating Point -> 32-bit IEEE Floating Point
INFO:     Channels:    2 -> 2
INFO:     Sample Rate: 48000 -> 48000
INFO:     Buffer Size: 1440*1 (1440)
INFO:     Conversion:
INFO:       Pre Format Conversion:  NO
INFO:       Post Format Conversion: 
Lost connection to device.
Failed to send request: {"jsonrpc":"2.0","id":"20","method":"getObject","params":{"isolateId":"isolates/3140592888150543","objectId":"libraries/@557171358"}}
Ifilehk commented 1 year ago

Back. Of course it works, the same function is used to load a file!

But it seems, if the size of the byte array is too small, may be smaller than the buffer, the app crashes ...

DaniilAlpha commented 11 months ago

Hi. It looks like you are trying to load data with the wrong format. Can you provide this data as well as the code you are using to load it. Also some info about your OS would be great.

P.S. Although this is wrong behavior: it should throw an exception instead of crashing the application. I'm going to fix that right now.