Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onFlush #405

Open
jackluoluo opened this issue Sep 18, 2024 · 1 comment
Open

onFlush #405

jackluoluo opened this issue Sep 18, 2024 · 1 comment

Comments

@jackluoluo
Copy link

Why can't this function fire?
my code here

 mp4boxfile.onReady = function (info) {
              console.log("MP4 File Parsed, Info: ", info);
              info.tracks.forEach(function (track) {
                if (track.type === "audio") {
                  console.log("Found audio track:", track);
                  mp4boxfile.setExtractionOptions(track.id);
                  mp4boxfile.start();
                }
              });
            };

            mp4boxfile.onSamples = function (id, user, samples) {
              console.log(`Extracted ${samples.length} audio samples.`);
              samples.forEach((sample) => {
                extractedAudioSamples.push(sample.data);
              });
            };
            mp4boxfile.onFlush = function () {
              console.log("Audio extraction completed.");
@davemevans
Copy link
Contributor

There is no onFlush callback, so there is nothing to trigger it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants