jenius-apps / ambie

An app that uses white noise, nature sounds, and focus features to boost your productivity.
https://ambieapp.com
MIT License
1.93k stars 142 forks source link

Add support to choose output audio device #347

Closed validvoid closed 1 year ago

validvoid commented 1 year ago

This PR adds support for users to choose output device for sound playback.

A new settings card is added to the settings page with a ComboBox listing all currently available devices for playing the sounds.

Users may expect to specifically use a physical or virtual device for Ambie to play sounds. For example, using a sound bar to play Ambie sounds to make people feel cozy in the room while listening to a podcast with a headset. There're also many widely used audio mixer applications like VoiceMeeter, SteelSeries SONAR etc. SteelSeries's SONAR software adds three virtual audio devices for gaming, media, and chat. Users can easily adjust the balance between those channels or apply different EQ profiles.

How to test:

  1. Launch Ambie and choose a different device as the output device like your monitor, a soundbar, a headset or a virtual device from a mixer software. All the currently playing sounds should be redirected to use the new endpoint for playback in real time.
  2. While keeping using the default device, open the system sound settings, change the default output device of the system and check if Ambie immediately uses the new default device to play the sounds.

Localization:

The strings for Simplified Chinese have been manually translated in this PR. @dpaulino You may need to trigger the machine translation generation again to ensure the strings are also translated in other languages.

dpaulino commented 1 year ago

this is super cool. Someone was just requesting for this feature the other day. I will test it out soon, thanks Will!

dpaulino commented 1 year ago

For the WindowsMediaPlayer class, it's used for both sounds and for sound effects (like a bell sound when you finish a task).

From a user perspective, which experience do you think is better?

  1. User sets their audio output to be device X, and all audio goes to device X
  2. User sets their audio output to be device X. Sounds go to device X but sound effects like bell go to default device.

We might need to make some changes depending on what experience is the best. Let me know what you think

validvoid commented 1 year ago

For the WindowsMediaPlayer class, it's used for both sounds and for sound effects (like a bell sound when you finish a task).

From a user perspective, which experience do you think is better?

  1. User sets their audio output to be device X, and all audio goes to device X
  2. User sets their audio output to be device X. Sounds go to device X but sound effects like bell go to default device.

We might need to make some changes depending on what experience is the best. Let me know what you think

I prefer #2. Considering the sound effects are part of the experience of Ambie, I assume users will use both white noise and focus together. So it makes sense to redirect the whole audio outputs to the user selected device. Personally, I'm using SteelSeries's GG software. It sets its virtual device for gaming as the default device by default. If you change the default device from the OS settings, it warns you that you are not using the correct configuration. However, an EQ profile or noise cancellation may be enabled for the gaming channel. That will bring the white noise sounds into the void.

dpaulino commented 1 year ago

Merged and a kicked off a new build for the alpha group! @validvoid are you in the alpha flight group already? Would be great to have you test it once it's available.

Thanks again for adding this!

validvoid commented 1 year ago

@dpaulino Nope. How do I join the group?

dpaulino commented 1 year ago

@validvoid send me your personal MSA and I'll add you to the group. Maybe send via teams or discord