eopeter / flutter_dtmf Goto Github PK
View Code? Open in Web Editor NEWDTMF Tone Generator for Flutter Applications.
License: MIT License
DTMF Tone Generator for Flutter Applications.
License: MIT License
I ran my app on the following Android tablet : RugGEAR RG910, Android 8.0.0.
The code I used is the same I use and tested on several phones : Samsung A52, Pixel 6a, Pixel 4a, and a Xperia.
It works on all the phones.
On the tablet, I know the function is called, but no sound is played.
No error is displayed.
Of course I checked that the sound is on.
I also tried to run the exemple code, and it run with the exact same behaviour : no sound but no error on the tablet.
(I also run the exemple on my ohines for comparisons and it works)
I have no idea if the isuue is fom the tablet itself or its Android version.
Could anyone try to Run the exemple in another Android tablet and tell me if they have the same issue ?
I am using this library to play a sound very rapidely (up to every 200ms), and it randomly crash at some point.
Looking for this issue online, I have found a fix :
The Tone Grenerator must be released after each use with the following function : toneGenerator.release();
You can find the explaination here :
https://stackoverflow.com/questions/13463691/error-generating-beep-using-tonegenerator-class
I have tested the fix and it worked well for me so I will do a pull request for this fix.
When you try to run the example in a web browser flutter run -d chrome
, the following exception is getting thrown:
β― flutter run -d chrome [16:18:18]
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome... 16,1s
This app is linked to the debug service: ws://127.0.0.1:56296/iBwJvijl5Fg=/ws
Debug service listening on ws://127.0.0.1:56296/iBwJvijl5Fg=/ws
πͺ Running with sound null safety πͺ
π₯ To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".
An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:56296/iBwJvijl5Fg=
Flutter Web Bootstrap: Programmatic
Error: Binding has not yet been initialized.
The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the
former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling
it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method
to initialize the binding.
If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but
that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.
at Object.throw_ [as throw] (http://localhost:56218/dart_sdk.js:5080:11)
at http://localhost:56218/packages/flutter/src/foundation/binding.dart.lib.js:81:21
at BindingBase.checkInstance (http://localhost:56218/packages/flutter/src/foundation/binding.dart.lib.js:103:26)
at get instance [as instance] (http://localhost:56218/packages/flutter/src/services/restoration.dart.lib.js:5825:35)
at platform_channel.MethodChannel.new.setMethodCallHandler
(http://localhost:56218/packages/flutter/src/services/restoration.dart.lib.js:1592:74)
at DtmfPlugin.registerWith (http://localhost:56218/packages/flutter_dtmf/dtmf_web.dart.lib.js:48:15)
at Object.registerPlugins
(http://localhost:56218/packages/flutter_dtmf_example/generated_plugin_registrant.dart.lib.js:13:25)
at http://localhost:56218/web_entrypoint.dart.lib.js:39:39
at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
at Object.dcall (http://localhost:56218/dart_sdk.js:5284:17)
at http://localhost:56218/dart_sdk.js:140287:18
at Generator.next (<anonymous>)
at runBody (http://localhost:56218/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:56218/dart_sdk.js:40691:7)
at _engine.AppBootstrap.new.<anonymous> (http://localhost:56218/dart_sdk.js:140285:67)
at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
at Object.callMethod (http://localhost:56218/dart_sdk.js:5322:17)
at Object.dsend (http://localhost:56218/dart_sdk.js:5325:17)
at _engine.AppBootstrap.new.<anonymous> (http://localhost:56218/dart_sdk.js:140636:22)
at Generator.next (<anonymous>)
at runBody (http://localhost:56218/dart_sdk.js:40660:34)
at Object._async [as async] (http://localhost:56218/dart_sdk.js:40691:7)
at http://localhost:56218/dart_sdk.js:140635:215
at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
at Object.dcall (http://localhost:56218/dart_sdk.js:5284:17)
at ret (http://localhost:56218/dart_sdk.js:62210:21)
at new Promise (<anonymous>)
at http://localhost:56218/dart_sdk.js:140635:119
at Object._checkAndCall (http://localhost:56218/dart_sdk.js:5279:16)
at Object.dcall (http://localhost:56218/dart_sdk.js:5284:17)
at Object.ret [as runApp] (http://localhost:56218/dart_sdk.js:62210:21)
at http://localhost:56218/:53:26
the Dart compiler exited unexpectedly.
My environment is set up like this:
β― flutter doctor -v [16:19:31]
[β] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-x64, locale de-DE)
β’ Flutter version 3.0.2 at /Users/ralfweinbrecher/Development/flutter
β’ Upstream repository https://github.com/flutter/flutter.git
β’ Framework revision cd41fdd495 (3 weeks ago), 2022-06-08 09:52:13 -0700
β’ Engine revision f15f824b57
β’ Dart version 2.17.3
β’ DevTools version 2.12.2
[β] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
β’ Android SDK at /Users/ralfweinbrecher/Library/Android/sdk/
β’ Platform android-31, build-tools 31.0.0
β’ ANDROID_HOME = /Users/ralfweinbrecher/Library/Android/sdk/
β’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
β’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
β’ All Android licenses accepted.
[β] Xcode - develop for iOS and macOS (Xcode 13.4.1)
β’ Xcode at /Applications/Xcode.app/Contents/Developer
β’ CocoaPods version 1.11.3
[β] Chrome - develop for the web
β’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[β] Android Studio (version 2021.1)
β’ Android Studio at /Applications/Android Studio.app/Contents
β’ Flutter plugin can be installed from:
π¨ https://plugins.jetbrains.com/plugin/9212-flutter
β’ Dart plugin can be installed from:
π¨ https://plugins.jetbrains.com/plugin/6351-dart
β’ Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[β] VS Code (version 1.68.1)
β’ VS Code at /Applications/Visual Studio Code.app/Contents
β’ Flutter extension version 3.42.0
[β] Connected device (3 available)
β’ iPhone 13 Pro (mobile) β’ B233C434-89BA-4CFC-AF42-DFAFF451FA14 β’ ios β’
com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
β’ macOS (desktop) β’ macos β’ darwin-x64 β’ macOS 12.4 21F79 darwin-x64
β’ Chrome (web) β’ chrome β’ web-javascript β’ Google Chrome 102.0.5005.115
! Error: iPhone is not connected. Xcode will continue when iPhone von Ralf is connected. (code -13)
[β] HTTP Host Availability
β’ All required HTTP hosts are available
β’ No issues found!
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
βοΈ Creating android/settings_aar.gradle
...
[!] Flutter tried to create the file android/settings_aar.gradle
, but failed.
Thanks for this. Using it here:
It would be great if it follows the platform settings
Since the last commit I have a new error, both on my Pixel 6A and a Sony Xperia.
The error is the following :
AUDIO_OUTPUT_FLAG_FAST denied by server;
E/AudioTrack(21895): AudioFlinger could not create track, status: -12
E/ToneGenerator(21895): AudioTrack(0x7e49992400) set failed with error -12
The weird thing is that the plugging do work without error on my Samsunf A52.
I digged the code a little bit and found a fix that seems to fix my error on both phone. I'll submit a pull request.
I tried this library on two of my phone, and I feel like even with max volume (volume = 1), the sound is not realy loud.
It feels like maybe to sound is generated like in a call, so you have to have you ear on the phone to hear it.
Would it be possible, to make the sound louder, like maybe played like when you phone is on "speaker mode" ?
That would be very usefull to me, thanks you very much !
Passing a country code (eg. "+48") to playTone()
makes it crash so hard that even a try-catch will not help. Android.
Would it be possible to publish on the pub.dev the V 3.0.3 which contains the last PR ?
Thank you very much.
Is there any chance you can add the ability to play the DTMF to the microphone but not the mobile phone speaker?
So we can play the DTMF to the call but the user would not hear it.
Pause the music player when assigning mainMixerNode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.