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

Add ebur128_reset to reset measurements #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renaud-sc
Copy link

@renaud-sc renaud-sc commented Feb 11, 2020

Useful when used as a Live Loudness Meter

Check #100

Useful when used as a Live Loudness Meter
@@ -1457,3 +1457,42 @@ int ebur128_prev_true_peak(ebur128_state* st,
st->d->prev_sample_peak[channel_number]);
return EBUR128_SUCCESS;
}

void ebur128_reset(ebur128_state *st) {
unsigned int i;
Copy link
Contributor

@bmatherly bmatherly Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this code is redundant with code in ebur128_init(). Maybe there could be a common function they both call?

Copy link
Author

@renaud-sc renaud-sc Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully agree

@@ -1457,3 +1457,42 @@ int ebur128_prev_true_peak(ebur128_state* st,
st->d->prev_sample_peak[channel_number]);
return EBUR128_SUCCESS;
}

void ebur128_reset(ebur128_state *st) {
Copy link
Contributor

@bmatherly bmatherly Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same effect could be achieved by the application by simply calling destroy() and init(). I think it would be worthwhile to discuss the need for this function (and the extra code to maintain). I am not against it, just opening discussion.

Copy link
Author

@renaud-sc renaud-sc Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's what I first think of but you would free and reallocate quite a few (other) things which may not be ideal in "live" operation. Of course you would not do that in the real-time audio thread but still.

Copy link
Author

@renaud-sc renaud-sc Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing: if destroy() and init() is chosen, how would you achieve the Pause/Continue feature ? See #100

Copy link
Contributor

@bmatherly bmatherly Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for Pause, you would stop sending data to the library and for Continue, you would resume sending data. So the application can just throw away audio data when paused.

Copy link
Author

@renaud-sc renaud-sc Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then the momentary value would not be computed any more, perhaps you still want it ?

Copy link
Contributor

@bmatherly bmatherly Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps. I guess I am not familiar with the use case for pause and which measurements should be paused and why.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pause should just not listening to the audio coming so no further values are calculated during that time.
While you are live you sometimes have to play something very different, e.g. for monitoring. Than just hit pause, play that other and then resume.

@Creepercdn
Copy link

Creepercdn commented Jun 18, 2021

you should add ebur128_clear to ebur128.def

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

Successfully merging this pull request may close these issues.

None yet

4 participants