Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NyquistIO::Load(xxx.flac) caught internal exception: Unable to initialize FLAC decoder #7

Open
zhushenwudi opened this issue May 5, 2022 · 2 comments

Comments

@zhushenwudi
Copy link

dalao你好,报错说没有 flac 解码器,如何支持 flac 播放呢?

@zhushenwudi
Copy link
Author

当我使用 buffer 模式时会崩溃
final music = await rootBundle.load('assets/music/01.flac');
audioBus = await AudioBus.fromBuffer(music.buffer.asUint8List());

Log:
caught internal loading exception: FLAC decode exception FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: FLAC decode exception FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC

  • thread #29, stop reason = signal SIGABRT
    frame #0: 0x00000001b1e66df0 libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib__pthread_kill:
    -> 0x1b1e66df0 <+8>: b.lo 0x1b1e66e0c ; <+36>
    0x1b1e66df4 <+12>: stp x29, x30, [sp, #-0x10]!
    0x1b1e66df8 <+16>: mov x29, sp
    0x1b1e66dfc <+20>: bl 0x1b1e450e8 ; cerror_nocancel
    Target 0: (Runner) stopped.

@xioxin
Copy link
Owner

xioxin commented May 8, 2022

抱歉, 由于工作比较忙,没有及时回复

FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC 流中的错误导致解码器失去同步。这意味着软件无法正确读取文件。它可能是由 FLAC 文件中的结构错误的数据、FLAC 文件中帧内的音频损坏或许多其他原因引起的。

可以先试试其他的flac音频,
或者试试将文件写入到磁盘,通过AudioBus.fromFile 加载.(fromBuffer没有对大文件进行测试,可能存在问题)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants