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

The start/end_listening sounds should be called with the pulse media.role=phone to enable ducking #36

Closed
Ramblurr opened this issue Jan 11, 2023 · 2 comments · Fixed by OpenVoiceOS/ovos-utils#201
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Ramblurr
Copy link
Contributor

Copied from MycroftAI/mycroft-core#3148

This will likely never get fixed upstream since MycrodtAI has moved on to dinkum. But now that I am building my home setup around ovos, maybe there is a chance?

The linked ticket describes the issue.

Basically, the start listening sound play command should be passed the same environment as the tts play command.

This let's pulse properly handle ducking of the start listening sound.

Without this, as it currently stands, the start listening sound is played without the phone role, so it is treated as music. This is problematic because I want the start listening sound and the tts to be played at the same volume.

@JarbasAl
Copy link
Member

the fix for this should be simple and go here https://github.com/OpenVoiceOS/ovos-utils/blob/dev/ovos_utils/sound/__init__.py

@JarbasAl JarbasAl added bug Something isn't working good first issue Good for newcomers labels Jan 11, 2023
@JarbasAl JarbasAl transferred this issue from OpenVoiceOS/ovos-core Jan 11, 2023
@JarbasAl JarbasAl transferred this issue from OpenVoiceOS/ovos-utils Oct 25, 2023
@emphasize
Copy link
Member

emphasize commented Nov 7, 2023

Have to check os.environ. The way this is coded is weird and indicates the common PULSE_PROP environmental variable is media.role=phone

_ENVIRONMENT = deepcopy(os.environ)
_ENVIRONMENT['PULSE_PROP'] = 'media.role=music'


def _get_pulse_environment(config):
    """Return environment for pulse audio depeding on ducking config."""
    tts_config = config.get('tts', {})
    if tts_config and tts_config.get('pulse_duck'):
        return _ENVIRONMENT
    else:
        return os.environ

But the more likely interpretation is that the ducking media role is misunderstood (music ducks phone).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants