[MPlayer-users] Mplayer makes small popping/static sound when speed_set is used

Brad Hermanson apeitheo at gmail.com
Mon Jul 17 01:48:34 EEST 2023


Reimar,

This is the mplayer command I'm using:

mplayer -slave -osdlevel 0 -ao pulse -softvol -softvol-max 100 -hr-mp3-seek
-quiet -input file="pipe" -noconfig all -af
equalizer=0:0:0:0:0:0:0:0:0:0,volnorm

It also loads the scaletempo filter with speed=pitch or speed=tempo
sometimes depending on what that particular media is locked with. The
clicking seems to happen regardless of what I use on -af.

By default, the "j" and "k" keys cause playback speed and pitch to lower or
raise by echo'ing (it's just bash script) speed_set commands that would be
equivalent to adjustments in, for example, semitones.

I got the idea in the mplayer man page:

"Add  `speed_mult  0.9438743126816935´  and  `speed_mult
 1.059463094352953´ to your input.conf to step by musical semi-tones."

My program just calculates the correct numbers to adjust by anything,
12-EDO (semitone) and beyond. Default is currently 60-EDO.

If I'm understanding ChatGPT and you correctly, I wouldn't want the sample
rate to stay the same, since the desired effect, by default, is to lower or
raise pitch/speed. I'm not sure about anything beyond that since I don't
know the technical aspect of sound. The clicking sound is only a minor
issue for me and I've just accepted it, though it would probably prevent my
program from being used professionally.

I suppose depending on the scaletempo setting it wouldn't click, but the
desired effect by default is changing playback speed and pitch.

Thanks for the help.

On Sun, Jul 16, 2023 at 4:50 PM Reimar Döffinger <Reimar.Doeffinger at gmx.de>
wrote:

>
>
> > On 16 Jul 2023, at 04:34, Brad Hermanson <apeitheo at gmail.com> wrote:
> >
> > Over the past two years I've developed a command-line front-end to
> MPlayer
> > called Aletheia that features front-and-center pitch controls using music
> > intervals (e.g. 1/12 of an interval for a semitone, but works with any
> > EDO), and it utilizes speed_set to adjust. Everything works great;
> however,
> > there is a slight clicking/popping/static sound on a speed_set change.
>
> speed_set reinitializes the audio filter chain to adjust to the new sample
> rate.
> If you give an example of the exact filter chain (or better full command
> line)
> and audio output you are using, there's a better chance someone can take a
> look
> and tell you what goes on.
> Maybe you are doing things in a way that results in a sample rate change in
> the audio output: then the behaviour would be unsurprising.
> Maybe you are already using a resampler to ensure the final rate stays the
> same,
> in that case maybe there's just some logic missing to prevent the rest of
> the
> filter chain from being re-initialized etc.
>
> Best regards,
> Reimar
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>

On Sun, Jul 16, 2023 at 4:50 PM Reimar Döffinger <Reimar.Doeffinger at gmx.de>
wrote:

>
>
> > On 16 Jul 2023, at 04:34, Brad Hermanson <apeitheo at gmail.com> wrote:
> >
> > Over the past two years I've developed a command-line front-end to
> MPlayer
> > called Aletheia that features front-and-center pitch controls using music
> > intervals (e.g. 1/12 of an interval for a semitone, but works with any
> > EDO), and it utilizes speed_set to adjust. Everything works great;
> however,
> > there is a slight clicking/popping/static sound on a speed_set change.
>
> speed_set reinitializes the audio filter chain to adjust to the new sample
> rate.
> If you give an example of the exact filter chain (or better full command
> line)
> and audio output you are using, there's a better chance someone can take a
> look
> and tell you what goes on.
> Maybe you are doing things in a way that results in a sample rate change in
> the audio output: then the behaviour would be unsurprising.
> Maybe you are already using a resampler to ensure the final rate stays the
> same,
> in that case maybe there's just some logic missing to prevent the rest of
> the
> filter chain from being re-initialized etc.
>
> Best regards,
> Reimar
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>


More information about the MPlayer-users mailing list