Canardoux / flutter_sound

Flutter plugin for sound. Audio recorder and player.
Mozilla Public License 2.0
878 stars 574 forks source link

Setvolumepan #1074

Closed changcw83 closed 3 months ago

changcw83 commented 3 months ago

technically implemented setvolume pan but got the following when running example

E/flutter (10299): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method setVolumePan on channel xyz.canardoux.flutter_sound_player) E/flutter (10299): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332) E/flutter (10299): E/flutter (10299): https://github.com/Canardoux/flutter_sound/issues/1 MethodChannelFlutterSoundPlayer.invokeMethod (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:139) E/flutter (10299): E/flutter (10299): https://github.com/Canardoux/flutter_sound/issues/2 FlutterSoundPlayer._setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1306) E/flutter (10299): E/flutter (10299): https://github.com/Canardoux/flutter_sound/pull/3 FlutterSoundPlayer.setVolumePan. (package:flutter_sound/public/flutter_sound_player.dart:1289) E/flutter (10299): E/flutter (10299): https://github.com/Canardoux/flutter_sound/issues/4 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33) E/flutter (10299): E/flutter (10299): https://github.com/Canardoux/flutter_sound/issues/5 FlutterSoundPlayer.setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1288) E/flutter (10299): E/flutter (10299): https://github.com/Canardoux/flutter_sound/issues/6 _VolumePanControlState.setVolume1 (package:example/volumepan_control/volumepan_control.dart:108) E/flutter (10299): E/flutter (10299):

Larpoux commented 3 months ago

Did you do something for the web ? It is important, at least that it compiles correctly and run without a crash. Even if you don't want to support your feature on web. The sources are in the flutter_sound_web repo and the class which derives from your interface is :

class FlutterSoundPlayerWeb
    extends FlutterSoundPlayerPlatform //implements FlutterSoundPlayerCallback
{

You will have to do a Pull request in this repo, too.

Larpoux commented 3 months ago

I realize that the repo is not under canardoux but under larpoux. I don't remember why ... flutter_sound_web

changcw83 commented 3 months ago

Yes I did, do you see the pull request?

On Sun, 18 Aug 2024 at 22:59, Larpoux @.***> wrote:

I realize that the repo is not under canardoux but under larpoux. I don't remember why ... flutter_sound_web https://github.com/Larpoux/flutter_sound_web.git

— Reply to this email directly, view it on GitHub https://github.com/Canardoux/flutter_sound/pull/1074#issuecomment-2295291399, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OPLYUXER27YLASGYPKI3ZSCZG5AVCNFSM6AAAAABMWMMSRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGI4TCMZZHE . You are receiving this because you authored the thread.Message ID: @.***>

Larpoux commented 3 months ago

OK. GOOD! Can you do something for the documentation ? No need to do something very complicated. Just add your new API verb in the list.

changcw83 commented 3 months ago

Done

On Sun, 18 Aug 2024 at 23:28, Larpoux @.***> wrote:

Merged #1074 https://github.com/Canardoux/flutter_sound/pull/1074 into master.

— Reply to this email directly, view it on GitHub https://github.com/Canardoux/flutter_sound/pull/1074#event-13922338122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OPLY7ZLPN4Y4W24U22VLZSC4SXAVCNFSM6AAAAABMWMMSRWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTHEZDEMZTHAYTEMQ . You are receiving this because you authored the thread.Message ID: @.***>

Larpoux commented 3 months ago

Can you push your modifs into your fork ?

Larpoux commented 3 months ago

OK, I got your modifs. I am going to do some tests and then I will do a new version, today or tomorrow.

Larpoux commented 3 months ago

Flutter Sound does not compile on iOS :

/Volumes/mac-J/larpoux/projmac/tau/flutter_sound/flutter_sound_core/ios/Classes/FlautoPlayerEngine.mm:120:8: error: non-void function does not return a value [-Werror,-Wreturn-type]
  120 |        }
      |        ^
/Volumes/mac-J/larpoux/projmac/tau/flutter_sound/flutter_sound_core/ios/Classes/FlautoPlayerEngine.mm:399:17: warning: method definition for 'setPan:' not found [-Wincomplete-implementation]
  399 | @implementation AudioEngineFromMic
      |                 ^
In file included from /Volumes/mac-J/larpoux/projmac/tau/flutter_sound/flutter_sound_core/ios/Classes/FlautoPlayerEngine.mm:28:
/Volumes/mac-J/larpoux/projmac/tau/flutter_sound/flutter_sound_core/ios/Classes/FlautoPlayerEngine.h:110:8: note: method 'setPan:' declared here
  110 |        - (void) setPan: (double) pan ;       
      |        ^
1 warning and 1 error generated.
Larpoux commented 3 months ago

Your example does not seem to work on my Android emulator : both the volume control and the pan control do not have any effect.

Larpoux commented 3 months ago

Same on Chrome.

Larpoux commented 3 months ago

on Chrome, you seems not having implemented the new function declared in the interface :

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ #0   packages/flutter_sound/public/flutter_sound_player.dart 1294:5                  _setVolumePan
│ #1   packages/flutter_sound/public/flutter_sound_player.dart 1293:29                 [_setVolumePan]
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ 🐛 FS:---> setVolumePan 
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3                   throw_
packages/flutter_sound_platform_interface/flutter_sound_player_platform_interface.dart 214:5  setVolumePan
packages/flutter_sound/public/flutter_sound_player.dart 1306:59                               _setVolumePan
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                            <fn>
dart-sdk/lib/async/zone.dart 1661:54                                                          runUnary
dart-sdk/lib/async/future_impl.dart 163:18                                                    handleValue
dart-sdk/lib/async/future_impl.dart 861:44                                                    handleValueCallback
dart-sdk/lib/async/future_impl.dart 890:13                                                    _propagateToListeners
dart-sdk/lib/async/future_impl.dart 666:5                                                     [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 736:7                                                     callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                                              _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                                               _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7                            <fn>
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ #0   packages/flutter_sound/public/flutter_sound_player.dart 1294:5                  _setVolumePan
│ #1   packages/flutter_sound/public/flutter_sound_player.dart 1293:29                 [_setVolumePan]
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ 🐛 FS:---> setVolumePan 
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3                   throw_
packages/flutter_sound_platform_interface/flutter_sound_player_platform_interface.dart 214:5  setVolumePan
packages/flutter_sound/public/flutter_sound_player.dart 1306:59                               _setVolumePan
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                            <fn>
dart-sdk/lib/async/zone.dart 1661:54                                                          runUnary
dart-sdk/lib/async/future_impl.dart 163:18                                                    handleValue
dart-sdk/lib/async/future_impl.dart 861:44                                                    handleValueCallback
dart-sdk/lib/async/future_impl.dart 890:13                                                    _propagateToListeners
dart-sdk/lib/async/future_impl.dart 666:5                                                     [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 736:7                                                     callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                                              _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                                               _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7                            <fn>
Larpoux commented 3 months ago

Same on Android : you seems not having implemented your new method :

E/flutter ( 5807): 
I/flutter ( 5807): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 5807): │ #0   FlutterSoundPlayer._setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1294:13)
I/flutter ( 5807): │ #1   FlutterSoundPlayer.setVolumePan.<anonymous closure> (package:flutter_sound/public/flutter_sound_player.dart:1289:13)
I/flutter ( 5807): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter ( 5807): │ 🐛 FS:---> setVolumePan 
I/flutter ( 5807): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
E/flutter ( 5807): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method setVolumePan on channel xyz.canardoux.flutter_sound_player)
E/flutter ( 5807): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): #1      MethodChannelFlutterSoundPlayer.invokeMethod (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:139:12)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): #2      FlutterSoundPlayer._setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1306:17)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): #3      FlutterSoundPlayer.setVolumePan.<anonymous closure> (package:flutter_sound/public/flutter_sound_player.dart:1289:7)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): #4      BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): #5      FlutterSoundPlayer.setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1288:5)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): #6      _VolumePanControlState.setPan1 (package:example/volumepan_control/volumepan_control.dart:120:5)
E/flutter ( 5807): <asynchronous suspension>
E/flutter ( 5807): 
I/flutter ( 5807): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 5807): │ #0   FlutterSoundPlayer.log (package:flutter_sound/public/flutter_sound_player.dart:347:13)
I/flutter ( 5807): │ #1   MethodChannelFlutterSoundPlayer.channelMethodCallHandler.<anonymous closure> (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:123:21)
I/flutter ( 5807): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter ( 5807): │ 🐛 [android]: Playback completed.
I/flutter ( 5807): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
changcw83 commented 3 months ago

Yes. Was trying to understand missingpluginexception

On Mon, 19 Aug 2024 at 01:00, Larpoux @.***> wrote:

Same on Android : you seems not having implemented your new method :

E/flutter ( 5807): I/flutter ( 5807): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter ( 5807): │ #0 FlutterSoundPlayer._setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1294:13) I/flutter ( 5807): │ #1 FlutterSoundPlayer.setVolumePan. (package:flutter_sound/public/flutter_sound_player.dart:1289:13) I/flutter ( 5807): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter ( 5807): │ 🐛 FS:---> setVolumePan I/flutter ( 5807): └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── E/flutter ( 5807): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method setVolumePan on channel xyz.canardoux.flutter_sound_player) E/flutter ( 5807): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7) E/flutter ( 5807): E/flutter ( 5807): #1 MethodChannelFlutterSoundPlayer.invokeMethod (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:139:12) E/flutter ( 5807): E/flutter ( 5807): #2 FlutterSoundPlayer._setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1306:17) E/flutter ( 5807): E/flutter ( 5807): #3 FlutterSoundPlayer.setVolumePan. (package:flutter_sound/public/flutter_sound_player.dart:1289:7) E/flutter ( 5807): E/flutter ( 5807): #4 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16) E/flutter ( 5807): E/flutter ( 5807): #5 FlutterSoundPlayer.setVolumePan (package:flutter_sound/public/flutter_sound_player.dart:1288:5) E/flutter ( 5807): E/flutter ( 5807): #6 _VolumePanControlState.setPan1 (package:example/volumepan_control/volumepan_control.dart:120:5) E/flutter ( 5807): E/flutter ( 5807): I/flutter ( 5807): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter ( 5807): │ #0 FlutterSoundPlayer.log (package:flutter_sound/public/flutter_sound_player.dart:347:13) I/flutter ( 5807): │ #1 MethodChannelFlutterSoundPlayer.channelMethodCallHandler. (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:123:21) I/flutter ( 5807): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter ( 5807): │ 🐛 [android]: Playback completed. I/flutter ( 5807): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

— Reply to this email directly, view it on GitHub https://github.com/Canardoux/flutter_sound/pull/1074#issuecomment-2295326328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OPL6A2JOK6HW3DPIIIQDZSDHKLAVCNFSM6AAAAABMWMMSRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGMZDMMZSHA . You are receiving this because you authored the thread.Message ID: @.***>

changcw83 commented 3 months ago

fixed.