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

Problem with Duration #48

Closed
csacchetti opened this issue Jan 30, 2020 · 0 comments
Closed

Problem with Duration #48

csacchetti opened this issue Jan 30, 2020 · 0 comments

Comments

@csacchetti
Copy link

I found a problem with the value that Duration Function provides. I noticed the error when I implemented the function in the BlockScreen notification window. The system slider (of iOS) did not move properly and terminated or before or after. I tried to compare the result that the Duration function provided and the actual length of the file and did not actually match.

I init the variable
double _audioDurationSeconds;

I load the file
_audio = Audio.load(
'assets/audios/${myVarList[indexVar][indexGo]}',
onComplete: () => setState(() => myComplete()),
onDuration: (double durationSeconds) =>
setState(() => _audioDurationSeconds = durationSeconds),
playInBackground: true,
);

I set metaData
AudioSystem.instance.setMetadata(AudioMetadata(
title: "${interfaceTexts.itInterfaceTexts["myText"]} ${resulVarList[0]}",
artist: myListTextMystery[indexVar][0] + " - " + myLabel,
durationSeconds: _audioDurationSeconds,
artBytes: imageBytes));

The result of _audioDurationSeconds don't match with the real duration of file (I see in the info windows) of the file. In each case a second less, in other a second more...

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

1 participant