rusty_ffi.dart
rusty_ffi.dart copied to clipboard
This is now highly outdated but still hits hight on search
Just wanted to let you know search for "dart ffi rust" hits your medium article but its from 2019, and now is highly outdated.
I got everything to work up to the point of doing the dart bridge, it was to much stuff that is not up to speed with dart 2024.
And past my knowledge to try to fix unfortunately 😅
Things to change:
- Stagehand is deprecated, baked into dart.
- Rodio interface is very different see code below for new interface.
let (_stream, stream_handle) = OutputStream::try_default().unwrap();
let file = BufReader::new(File::open(file_name).unwrap());
let source = Decoder::new(file).unwrap();
stream_handle.play_raw(source.convert_samples());
std::thread::sleep(std::time::Duration::from_secs(10));
And the stuff to do FFI I dont know, and did not use time to fix. I moved on D: