flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

[enh] startPlayerFromMic()

Open Larpoux opened this issue 4 years ago • 9 comments

  • [x] FlutterSound (dart)
  • [x] FlutterSoundPlatformInterface (dart)
  • [x] FlutterSoundPlatformInterface (iOS)
  • [x] FlutterSoundPlatformInterface (Android)
  • [x] Tau (iOS)
  • [x] Tau (Android)
  • [x] Example
  • [x] Doc

Several τ users need to play on the headset what is recorded by the microphone, in quasi-real-time.

I am convinced that implementing audio-graph will be the general solution and will be very elegant.

Unfortunately, I worry that I will have to leave the τ project before having implemented this terrific feature. (another project is waiting for me).

So, I think that we can implement a new simple verb startPlayerFromMic() before the great global solution. And use FFI instead of the Flutter channels if the App wants to be in cut-mode during the process instead of pass-threw.

Larpoux avatar Jan 02 '21 18:01 Larpoux

τ 7.5.0 implements this new verb.

This new example can be compared to the old loop example.

1. iOS

startPlayerFromMic() directely links the microphone to the headset inside the OS, without any processing by τ

The improvement is really good. The delay between what is recorded and what is played is much better.

2. Android

The link beetween the microphone and the headset is done inside τ-core. The messaging channels between Java and Dart is not involved. The audio data are just transfered from the recording-thread to the player thread.

This is a great disappointment : the performances are marginally improved. This means that implementing data transfert from/to Dart with FFI will not benefit from using FFI.

Larpoux avatar Jan 08 '21 14:01 Larpoux

We must improve the latency problem under Andoid.

Larpoux avatar Jan 11 '21 15:01 Larpoux

For my project the latency in Android is the most blocking issue (making it useless for now, sadly). Do you have any idea of the possible reason?

GGLabCenter avatar Feb 10 '21 21:02 GGLabCenter

For me it is the same, does flutter_sound use Oboe in Android to speed up the latency (also checkout following projects: https://www.youtube.com/watch?v=X8JD8hHkBMct=23m&t=23m, https://github.com/audiooffler/JucyFluttering)?

pffelix avatar Jan 14 '22 11:01 pffelix

Thank you for your feedback @pffelix . I do not know Oboe I really want something usable with Audio Streams. The latency is a big problem that I want to solve soon (in the 9.0 fork). I have big ideas for future development, but it will never be possible if too much latency

Larpoux avatar Jan 14 '22 16:01 Larpoux

this sample here describes how you can achieve minimal latency for audio passthrough on Android with Oboe: https://github.com/google/oboe/tree/main/samples/LiveEffect

pffelix avatar Jan 14 '22 17:01 pffelix

Thanks 👍

Larpoux avatar Jan 14 '22 17:01 Larpoux

Ref #90

Larpoux avatar Jan 15 '22 22:01 Larpoux

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 19 '23 01:12 github-actions[bot]