Caldarie / flutter_tflite_audio

Audio classification Tflite package for flutter (iOS & Android). Can support Google Teachable Machine models
MIT License
64 stars 26 forks source link

Start analyze audio only after threshold (decibels) #22

Closed bobosette closed 2 years ago

bobosette commented 3 years ago

Hi everybody. Do you know if it's possible starting analyze audio only when that audio exceeds a threshold (decibels)?

Caldarie commented 3 years ago

Hi @bobosette,

it’s possible. Though you may need to customise this package to do so if you’re willing to tinker a bit with Java and Swift.

you’re more than welcome to contribute to this plugin, if you’re willing to share of course.

bobosette commented 3 years ago

I tried to make a sort of merge of the usability between noise_meter package ( it let me check if an audio source gets higher than a threshold) and tfl_audio. It works, but the result doesn't seem perfect to me. But I don't know if that is the right way to implement what I want to do. I have to record/listen audio for a long time (at least 4 hours) and inside this time window i have to check/analyze if the audio is similar to the model from gtm. How would you do that?

Caldarie commented 3 years ago

I think it’s fine to use both packages, though I think you may experience a delay as these two may need time to communicate with one another. In my opinion, you could potentially reduce this delay if you directly modify the tflite audio package to detect decibels as well.

As for your next question, it’s possible to extend the detection/recording time by adjusting the parameter numOfInferences in this package. Though, im not sure what you mean by check/analyse if the audio is similar to the model from gtm. Can you clarify for me?

bobosette commented 3 years ago

I have to detect a sound (for example you can imagine a song theme (30 sec) which is going to be played a number of times) and i want to detect how many times that sound will be played. I have already tried to play with numOfInferences parameter but i didn't understand, this parameter is about the time (seconds) of analys?

Caldarie commented 3 years ago

Explaination for numOfInference

Each model has a maximum recording length. For example, for GTM models, the maximum recording length is around 44032, which is around 1 to 2 seconds if your bufferSize is 22050.

What numOfInference does is that it will extend the recording by looping over the maximum recording length, as well as return multiple inferences. For example: numOfInference = 3 will repeat the recording three times, so recording length will be (1 to 2 seconds) x 3 = (3 to 6 seconds). Also the model will output 3 results.

If you only want one result, but would also like to increase the length of the recording, you can lower your bufferSize. Though take care not to lower the bufferSize too much as this may negatively influence your inference accuracy.

I hope this answers your question.

bobosette commented 3 years ago

Ok now I understood. And if I want to extend the recording/analysis to at least 4 hours I have to change numOfInference from 1 to almost 14000, is it correct?

Il Gio 18 Nov 2021, 10:27 Michael Nguyen @.***> ha scritto:

Explaination for numOfInference

Each model has a maximum recording length. For example, for GTM models, the maximum recording length is around 44032, which is around 1 to 2 seconds if your bufferSize is 22050.

What numOfInference does is that it will extend the recording by looping over the maximum recording length, as well as return multiple inferences. For example: numOfInference = 3 will repeat the recording three times, so recording length will be (1 to 2 seconds) x 3 = (3 to 6 seconds). Also the model will output 3 results.

If you only want one output, but would also like to increase the length of the recording, you can lower your bufferSize. Though take care not to lower the bufferSize too much as this may negatively influence your inference accuracy.

I hope this answers your question.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-972685687, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4JSEQDRISZX6G2EM4DUMTBGPANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

That is correct. But if you want to stop precisely at 4 hours, I suggest that you set numOfInferences to a very high number like 99999. Then set a timer to four hours on flutter and call stopAudioRecognition. from the plugin

bobosette commented 3 years ago

Yes. You're right. Thanks man. I will let you know

Il Gio 18 Nov 2021, 10:55 Michael Nguyen @.***> ha scritto:

That is correct. But if you want to stop precisely at 4 hours, I suggest that you set numOfInferences to a very high number like 99999. Then set a timer to four hours on flutter and call stopAudioRecognition. from the plugin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-972709062, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4KZMHJG7WFWSWSSEG3UMTESNANCNFSM5IEVZCSA .

bobosette commented 3 years ago

Just another little thing. Can I get the percentage of the result? I saw that on the console when there is a result it prints Raw Scores: [0.98527735, 0.003569071, 0.011153544]. Where can I get this list?

Caldarie commented 3 years ago

I have yet to implement that feature yet, but i will provide an update in the very near future.

bobosette commented 3 years ago

Hi @Caldarie. I tried to set numOfInferences = 99999, first time I did the recognition everything worked fine, but if I stopped, and then I started again I got this error: java.lang.OutOfMemoryError: Failed to allocate a 2536243216 byte allocation with 6291456 free bytes and 298MB until OOM, target footprint 95760752, growth limit 402653184 E/AndroidRuntime(31894): at flutter.tflite_audio.TfliteAudioPlugin.record(TfliteAudioPlugin.java:398) E/AndroidRuntime(31894): at flutter.tflite_audio.TfliteAudioPlugin.access$000(TfliteAudioPlugin.java:59) E/AndroidRuntime(31894): at flutter.tflite_audio.TfliteAudioPlugin$3.run(TfliteAudioPlugin.java:383) E/AndroidRuntime(31894): at java.lang.Thread.run(Thread.java:919)

Caldarie commented 3 years ago

@bobosette thanks for the detailed bug report.

I’ll investigate it soon and will let you know.

bobosette commented 3 years ago

Maybe is that a way to delete the cache or something similar?? Cause it seems that when the service starts it allocates some memory. When the service stops it should release it. Is it right?

Il Sab 20 Nov 2021, 03:55 Michael Nguyen @.***> ha scritto:

@bobosette https://github.com/bobosette thanks for the detailed bug report.

I’ll investigate it soon and will let you know.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974581718, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4JYZ675HSCF2GLQELLUM4E37ANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

Yes that is correct. It seems this is the offending code:

 int maxRecordingLength = recordingLength * numOfInferences;
 maxRecordingBuffer = new short[maxRecordingLength];

As you could imagine, there's a limit to the size of an array. 99999 would probably cause the crash.

I'm thinking of using two arrays and swap it interchangeably when one array fills up, while resetting the other. Though, it's a bit difficult to implement.

bobosette commented 3 years ago

I could try to do something. Where is that part of code??

Il Sab 20 Nov 2021, 09:18 Michael Nguyen @.***> ha scritto:

Yes that is correct. It seems this is the offending code:

int maxRecordingLength = recordingLength * numOfInferences; maxRecordingBuffer = new short[maxRecordingLength];

I'm thinking of using two arrays and swap it interchangeably when one array fills up, while resetting the other. Though, it's a bit difficult to implement.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974614567, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4ITSS2XZYGVUTHL2DDUM5KWTANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

Any help would be greatly appreciated.

As you could see, the code below is overly complex and needs to be replaced. (Ive been needing to do so but just havent had time)

Goal is to replace all of the code below, and set two recording buffer arrays. The reason being that should there be a spill over (e.g. 16200/16000 which leaves a remaining 200), the remaining will be appended to the second array. The first recording buffer will be reset once the audio is fed into the model.

 while (shouldContinue) {
            //Reads audio data and records it into redcordFrame
            int numberRead = record.read(recordingFrame, 0, recordingFrame.length);

            recordingBufferLock.lock();
            try {

                //Continue to append frame until it reaches recording length
                //(recordingOffset + numberRead < maxRecordingLength) prevent out of index when buffer exceeds max record length
                if(recordingOffset < recordingEnd && recordingOffset + numberRead < maxRecordingLength){

                    System.arraycopy(recordingFrame, 0, maxRecordingBuffer, recordingOffset, numberRead);
                    recordingOffset += numberRead;
                    Log.v(LOG_TAG, "recordingOffset: " + recordingOffset + "/" + maxRecordingLength); 

                //When buffer reaches recording length inference starts. Resets inference loop
                } else if (recordingOffset >= recordingEnd && recordingOffset + numberRead < maxRecordingLength) {
                    Log.v(LOG_TAG, "Recording reached threshold");

                    System.arraycopy(recordingFrame, 0, maxRecordingBuffer, recordingOffset, numberRead);
                    recordingOffset += numberRead;
                    Log.v(LOG_TAG, "recordingOffset: " + recordingOffset + "/" + maxRecordingLength); 

                    System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                    startRecognition();

                    Log.v(LOG_TAG, "Creating new threshold");
                    recordingStart += recordingLength;
                    recordingEnd += recordingLength;

                //when buffer reaches max record length (recordingLength * numOfInference) start inference and stop recording
                } else if  (recordingOffset >= recordingEnd && recordingOffset + numberRead == maxRecordingLength){
                    Log.v(LOG_TAG, "Recording reached maximum threshold");

                    System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                    startRecognition();

                    stopRecording();
                    lastInferenceRun = true;

                //when buffer exeeds max record length, trim and resize the buffer, append, and then start inference
                } else if(recordingOffset + numberRead > maxRecordingLength) {
                    Log.v(LOG_TAG, "Recording exceeded maximum threshold");

                    Log.v(LOG_TAG, "Trimming recording frame and appending to recordingLength");
                    int missingRecordingLength = maxRecordingLength - recordingOffset - 1; 
                    short [] resizedRecordingFrame = Arrays.copyOf(recordingFrame, missingRecordingLength);
                    System.arraycopy(resizedRecordingFrame, 0, maxRecordingBuffer, recordingOffset, missingRecordingLength);
                    Log.v(LOG_TAG, "Recording trimmed and appended at length: " + missingRecordingLength + 1);
                    Log.v(LOG_TAG, "recordingOffset: " + (recordingOffset + missingRecordingLength + 1) + "/" + maxRecordingLength); 

                    System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                    startRecognition();

                    stopRecording();
                    lastInferenceRun = true;

                    //Used when theres only one inference, as the above if statements are used for multiple inferences
                    //Case occurs when buffersize is divisible to recording length
                    //Apends the last recordingFrame to recordingLength
                } else {

                    System.arraycopy(recordingFrame, 0, maxRecordingBuffer, recordingOffset, numberRead);
                    recordingOffset += numberRead;
                    Log.v(LOG_TAG, "recordingOffset: " + recordingOffset + "/" + maxRecordingLength); 

                    System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                    startRecognition();

                    stopRecording();
                    lastInferenceRun = true;
                }
bobosette commented 3 years ago

Mmm ok. I will try to do something. But, check this use case scenario: I start recording, 4/5 hours, then I stop and I navigate to another page showing the results and I destroy the recording page. Then I rebuild recording page and I instantiate again the TflAudio. In this case, the cache should be free, or not?

Il Sab 20 Nov 2021, 09:36 Michael Nguyen @.***> ha scritto:

Any help would be greatly appreciated.

As you could see, the code below is overly complex and needs to be replaced. (Ive been needing to do so but just havent had time)

Goal is to replace all of the code below, and set two recording buffer arrays. The reason being that should there be a spill over (e.g. 16200/16000 which leaves a remaining 200), the remaining will be appended to the second array. The first recording buffer will be reset once the audio is fed into the model.

while (shouldContinue) { //Reads audio data and records it into redcordFrame int numberRead = record.read(recordingFrame, 0, recordingFrame.length);

        recordingBufferLock.lock();
        try {

            //Continue to append frame until it reaches recording length
            //(recordingOffset + numberRead < maxRecordingLength) prevent out of index when buffer exceeds max record length
            if(recordingOffset < recordingEnd && recordingOffset + numberRead < maxRecordingLength){

                System.arraycopy(recordingFrame, 0, maxRecordingBuffer, recordingOffset, numberRead);
                recordingOffset += numberRead;
                Log.v(LOG_TAG, "recordingOffset: " + recordingOffset + "/" + maxRecordingLength);

            //When buffer reaches recording length inference starts. Resets inference loop
            } else if (recordingOffset >= recordingEnd && recordingOffset + numberRead < maxRecordingLength) {
                Log.v(LOG_TAG, "Recording reached threshold");

                System.arraycopy(recordingFrame, 0, maxRecordingBuffer, recordingOffset, numberRead);
                recordingOffset += numberRead;
                Log.v(LOG_TAG, "recordingOffset: " + recordingOffset + "/" + maxRecordingLength);

                System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                startRecognition();

                Log.v(LOG_TAG, "Creating new threshold");
                recordingStart += recordingLength;
                recordingEnd += recordingLength;

            //when buffer reaches max record length (recordingLength * numOfInference) start inference and stop recording
            } else if  (recordingOffset >= recordingEnd && recordingOffset + numberRead == maxRecordingLength){
                Log.v(LOG_TAG, "Recording reached maximum threshold");

                System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                startRecognition();

                stopRecording();
                lastInferenceRun = true;

            //when buffer exeeds max record length, trim and resize the buffer, append, and then start inference
            } else if(recordingOffset + numberRead > maxRecordingLength) {
                Log.v(LOG_TAG, "Recording exceeded maximum threshold");

                Log.v(LOG_TAG, "Trimming recording frame and appending to recordingLength");
                int missingRecordingLength = maxRecordingLength - recordingOffset - 1;
                short [] resizedRecordingFrame = Arrays.copyOf(recordingFrame, missingRecordingLength);
                System.arraycopy(resizedRecordingFrame, 0, maxRecordingBuffer, recordingOffset, missingRecordingLength);
                Log.v(LOG_TAG, "Recording trimmed and appended at length: " + missingRecordingLength + 1);
                Log.v(LOG_TAG, "recordingOffset: " + (recordingOffset + missingRecordingLength + 1) + "/" + maxRecordingLength);

                System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                startRecognition();

                stopRecording();
                lastInferenceRun = true;

                //Used when theres only one inference, as the above if statements are used for multiple inferences
                //Case occurs when buffersize is divisible to recording length
                //Apends the last recordingFrame to recordingLength
            } else {

                System.arraycopy(recordingFrame, 0, maxRecordingBuffer, recordingOffset, numberRead);
                recordingOffset += numberRead;
                Log.v(LOG_TAG, "recordingOffset: " + recordingOffset + "/" + maxRecordingLength);

                System.arraycopy(maxRecordingBuffer, recordingStart, recordingBuffer, 0, recordingLength);
                startRecognition();

                stopRecording();
                lastInferenceRun = true;
            }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974616349, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4MNDATYABYI2ODX5LLUM5MYZANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

I think cache should be free. I’d imagine cache would accumulate too much

bobosette commented 3 years ago

Ok ok. I will try something and I will let you know. Thank you

Il Sab 20 Nov 2021, 09:48 Michael Nguyen @.***> ha scritto:

I think cache should be free. I’d imagine cache would accumulate too much

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974617437, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4OM32CHNWPVTEO2C3LUM5OEHANCNFSM5IEVZCSA .

bobosette commented 3 years ago

here I am. Some updates. I tried to add on the android app manifest this line: android:largeHeap="true" so the application part of the example sounds like this: <application android:name="io.flutter.app.FlutterApplication" android:label="tflite_audio_example" android:icon="@mipmap/ic_launcher" android:largeHeap="true"> <activity

And it works, without losing performance, despite of what this link says https://stackoverflow.com/questions/27396892/what-are-advantages-of-setting-largeheap-to-true. I know it's not a good practice, but till if you don't fix that, I can try.

Now, what can we do with ios???

Caldarie commented 3 years ago

Hi @bobosette,

many thanks for looking up a solution. Appreciate he assistance.

I had a look at the link you’ve provided and it does indeed help with our problem. As you said, there may be no issues now; but, I feel this may cause unexpected problems down the line. Particularly when not everyone has access to high performance devices, or are running multiple apps at the same time.

as for iOS, it’s not a problem. Only just Java

bobosette commented 3 years ago

Yes, you're right, is not the solution. I'm doing many tried and it slows down the animation and the performance. We have to try something different

Il giorno dom 21 nov 2021 alle ore 02:29 Michael Nguyen < @.***> ha scritto:

Hi @bobosette https://github.com/bobosette,

many thanks for looking up a solution. Appreciate he assistance.

I had a look at the link you’ve provided and it does indeed help with our problem. As you said, there may be no issues now; but, I feel this may also cause further unexpected problems down the line. Particularly when not everyone has access to high performance devices, or are running multiple apps at the same time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974737811, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4PD4K2LWE3GPLDQK4DUNBDPLANCNFSM5IEVZCSA .

bobosette commented 3 years ago

Another question: does the service work if the app is in background? I did some tries but it seems not to work.

Il Dom 21 Nov 2021, 02:47 Roberto Bobo Prandin @.***> ha scritto:

Yes, you're right, is not the solution. I'm doing many tried and it slows down the animation and the performance. We have to try something different

Il giorno dom 21 nov 2021 alle ore 02:29 Michael Nguyen < @.***> ha scritto:

Hi @bobosette https://github.com/bobosette,

many thanks for looking up a solution. Appreciate he assistance.

I had a look at the link you’ve provided and it does indeed help with our problem. As you said, there may be no issues now; but, I feel this may also cause further unexpected problems down the line. Particularly when not everyone has access to high performance devices, or are running multiple apps at the same time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974737811, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4PD4K2LWE3GPLDQK4DUNBDPLANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

Unfortunately, I'm not knowledgeable with running the plugin in the background. Though, i think this is more of a flutter thing than the plugin in itself.

Good news is i found a solution in regards to the OutOfMemoryError and have successfully implemented in android. Once i sucesfully implemented the feature with outputting raw scores and upload the update, i will let you know.

bobosette commented 3 years ago

Oh perfect. Thank you, please let me know cause I have to implement this feature in a project as soon as possible. But for ios is the service working?

A solution for the background could be tell flutter to force the app to stay in foreground, so the phone will not stanb by

Caldarie commented 3 years ago

For the iOS, i think there is no problem considering that array size don't need to be fixed.

The problem is only with java since arrays need to be fixed for performance.

bobosette commented 3 years ago

Oh perfect. Thank you. Let me know when you update cause I need to implement this in a project as soon as possible 😅. For the background I'm reading these articles that maybe can help us:

https://pub.dev/packages/flutter_background

https://medium.com/vrt-digital-studio/flutter-workmanager-81e0cfbd6f6e

Il Dom 21 Nov 2021, 15:04 Michael Nguyen @.***> ha scritto:

For the iOS, i think there is no problem considering that array size don't need to be fixed.

The problem is only with java since arrays need to be fixed for performance.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-974823461, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4P2LHLJXSSI6XN2QXDUND35HANCNFSM5IEVZCSA .

bobosette commented 3 years ago

Hi @Caldarie . Any update??

Caldarie commented 3 years ago

I am currently testing for bugs.

Please be patient as I have been busy with other work lately.

bobosette commented 3 years ago

Sorry man. I can perfectly understand. I'm also busy with a lot of projects.

Il Mar 23 Nov 2021, 13:02 Michael Nguyen @.***> ha scritto:

I am currently testing for bugs.

Please be patient as I have been busy with other work lately.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-976445495, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4N3ZXBOBO3FGSF77OTUNN7GJANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

hi @bobosette

Good news, i have published the new update on dart pub

There should be no problems with memory crash on android. Seems like memory was issue for iOS, so I also fixed iOS as well.

I also added the ability to output rawScores. Check the example to see how to turn on this feature.

I have done alot of testing, but I may have missed on or two bugs. If you have time, please let me know if you experience any.

bobosette commented 3 years ago

Great @Caldarie. I tryed the update and the memory bug is fixed. Thank you. But, question: where can I get the rawScores?

bobosette commented 3 years ago

For the background, when I'm debuggin I see from the console that the recognizer keep going also in background but when I come back in foreground it seems to doesn't update the count of relevation

Caldarie commented 3 years ago

Great @Caldarie. I tryed the update and the memory bug is fixed. Thank you. But, question: where can I get the rawScores?

Basically set outputRawScores to true as shown on the example below:

    TfliteAudio.loadModel(
      model: 'assets/conv_actions_frozen.tflite',
      label: 'assets/conv_actions_label.txt',
      inputType: 'decodedWav',
      outputRawScores: true, //adjust this parameter 
      numThreads: 1,
      isAsset: this.isAsset,
    );

For the background, when I'm debuggin I see from the console that the recognizer keep going also in background but when I come back in foreground it seems to doesn't update the count of relevation

I am not sure that i follow you. Are you asking as to how to keep the stream running in the background? If so, unfortunately i am not knowledgable in this area. Perhaps this link could give you some hint?

bobosette commented 3 years ago

No I'm saying that the stream seems to running also in background, cause in the IDE console I can see that it prints (for example rawScores) also when the app 9s in background

Il Mer 24 Nov 2021, 09:44 Michael Nguyen @.***> ha scritto:

Great @Caldarie https://github.com/Caldarie. I tryed the update and the memory bug is fixed. Thank you. But, question: where can I get the rawScores?

TfliteAudio.loadModel(
  model: 'assets/conv_actions_frozen.tflite',
  label: 'assets/conv_actions_label.txt',
  inputType: 'decodedWav',
  outputRawScores: true, //set this parameter to true
  numThreads: 1,
  isAsset: this.isAsset,
);

For the background, when I'm debuggin I see from the console that the recognizer keep going also in background but when I come back in foreground it seems to doesn't update the count of relevation

I am not sure that i follow you. Are you asking as to how to keep the stream running in the background? If so, unfortunately i am not knowledgable in this area. Perhaps this link https://docs.flutter.dev/development/packages-and-plugins/background-processes could give you some hint?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Caldarie/flutter_tflite_audio/issues/22#issuecomment-977656581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEWB4J2QJQPSSLOGWAA4KDUNSQYVANCNFSM5IEVZCSA .

Caldarie commented 3 years ago

I see. The issue you are looking at seems to be related to the flutter background plugin. Honestly speaking, i am unsure how foreground and background processes work.

Can you try opening the issue over there? Perhaps if they offer a solution, I can implement it as a fix to this plugin.

bobosette commented 3 years ago

Mmm I could try following this article https://medium.com/flutter/executing-dart-in-the-background-with-flutter-plugins-and-geofencing-2b3e40a1a124 . But you should tell me both for android and ios what methods/functions I should run in background

bobosette commented 2 years ago

Hi @Caldarie . I tried the update. Works fine, no more memory issues. Thank you. Today I'm working on the background. I will let you know.

Caldarie commented 2 years ago

I’m glad to hear that.

if you have found that this project has been useful to you, please consider giving your support with a like or a star. Thankyou