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

[HELP]: About when to display the audio file duration in SoundPlayerUI #703

Open
uchidacode opened this issue Jun 19, 2021 · 13 comments
Open
Labels
help wanted Extra attention is needed Not yet handled

Comments

@uchidacode
Copy link

Here is my question :

First of all, thank you for creating a nice plugin.

What I would like to do this time is to call the fromTrack method of SoundPlayerUI and display how long the audio file is when the track is loaded. Is there any way to do this?

In the current situation, the duration is updated after the play button is pressed, so I want to change it when the track is loaded.

                  SoundPlayerUI.fromTrack(
                    track,
                    enabled: true,
                    showTitle: false,
                    audioFocus: AudioFocus.requestFocusAndDuckOthers,
                  ),
@uchidacode uchidacode added help wanted Extra attention is needed Not yet handled labels Jun 19, 2021
@Faaatman
Copy link

I have used the duration function but I don't think it works with tracks. If you have the audio file saved or the link to that file you can pass it to that function.

@Larpoux
Copy link
Collaborator

Larpoux commented Jul 14, 2021

I want to change it when the track is loaded.

Actually there is no call back when Flutter Sound finished the loading of the file.
Maybe you can load the file yourself and display the duration with :

Duration d = flutterSoundHelper.duration(myAudioFile);

@uchidacode
Copy link
Author

Thanks!!
fine working

@patelnirav48
Copy link

We are playing audio in SoundPlayerUI with url.. initially its showing 00:00 / 00:00 .. how can we display audio actual time in SoundPlayerUI widget?

@Larpoux
Copy link
Collaborator

Larpoux commented Jan 24, 2022

I am not sure that we can know the duration before starting the playback.
@Alvarocda : can you look to this issue ?
It seems that we really need to open the sound during the openPlayer().
If we do that, we will know the duration after openPlayer() and before startPlayer()

@Larpoux Larpoux reopened this Jan 24, 2022
@Alvarocda
Copy link
Collaborator

Alvarocda commented Jan 24, 2022

There is a way for us to know the duration of the audio before starting the playback, I already had to do that once.
If I'm not mistaken, this only works with the FULL version.

In issue 743 there is an example of how to do this

@Larpoux
Copy link
Collaborator

Larpoux commented Jan 24, 2022

Unfortunately there will not have FULL/LITE in 9.0.
We will not link to FFmpeg. The only way to know the duration is to open the sound.
I really think that we should open the sound in openPlayer and start the playback in startPlayer().
This way it would be possible to show the duration without starting the playback

@patelnirav48
Copy link

Thank you for your reply. It will be great help if we have this change. Thank you

@Larpoux
Copy link
Collaborator

Larpoux commented Jan 31, 2022

I agree with you. This change would be great. The API would be cleaner. I would like this very much .
But this change is not trivial and we actually have several contributors missing.

Personally I would like to start a new project : Taudio and I don't think I can do that if I have important maintenance to do on Flutter Sound.

We really need other contributors

@Larpoux
Copy link
Collaborator

Larpoux commented Jan 31, 2022

@patelnirav48,

I am going to look for this change this afternoon. I will tell you after if I decide to do this change now and delay the Taudio project

@patelnirav48
Copy link

@Larpoux Thank you very much, that will really a great help.

@Larpoux
Copy link
Collaborator

Larpoux commented Jan 31, 2022

I have just decided to delay Taudio during several weeks because I think that this change will be great for Flutter Sound.
That's a shame because I really think that Taudio will be a great project.
But I cannot leave Flutter Sound dying without maintenance.
Very soon we will have 777 likes on pub.dev. This means that I am working for 777 people who like what I am doing.
It makes me feel good. Very good.

This will be Flutter Sound 10.x : it will be major breaking changes in the API

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Not yet handled
Projects
None yet
Development

No branches or pull requests

5 participants