Built in Sound/ Picotutor

247 views
Skip to first unread message

Hansi

unread,
Mar 15, 2021, 3:59:36 PM3/15/21
to PicoChess
Hey there!
Is there a way, to change the volume from Picotutors voice? For me it's a way to loud compared with Christina's voice.

Best regards

RandyR

unread,
Mar 15, 2021, 5:08:22 PM3/15/21
to PicoChess
Hi Hansi,

I used the vorbisgain package (sudo apt install vorbisgain). Then:

cd /opt/picochess/talker/voices/en/

Backup the folder:

sudo cp -r christina christina.bak

To view the volume/gain info:

cd christina
vorbisgain -d -a -f *.ogg

To normalize:

sudo vorbisgain -a -f *.ogg

I like the results, but I haven't fully tested. Here's the man page:


Randy

LJR

unread,
Mar 15, 2021, 5:48:21 PM3/15/21
to pico...@googlegroups.com
Thanks for that, Randy.  I was experiencing the same issue as Hansi and your hack did the trick!


On Mar 15, 2021, at 5:08 PM, RandyR <randy...@gmail.com> wrote:

Hi Hansi,
--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/6d2ea6e9-93f1-4b9c-a382-756f815f6dc2n%40googlegroups.com.

Hansi

unread,
Mar 15, 2021, 7:40:55 PM3/15/21
to PicoChess

Thank you very much Randy. Now the tutor can't no longer shout at me and Christina :-).

Hansi

unread,
Mar 17, 2021, 10:22:10 AM3/17/21
to PicoChess
Again a question about the Sound, specially the volume:
In the menu of the DGTPI I can change the volume of the voices from 0 to 10, but there is no change? Same with the entry in the ini-file.

Is there something wrong or buggy? I use the lite-version

RandyR

unread,
Mar 17, 2021, 12:59:31 PM3/17/21
to PicoChess
Hi Hansi,

Thanks for pointing that out. I had left the alsa controller in the Lite image as Master (as used in the Desktop image where PulseAudio is the default controller) instead of reverting it to Headphone. I will fix the image, but here is how to do it:

Picochess sets the volume using the amixer command in the file /opt/picochess/dgt/menu.py:

1139    def set_volume_voice(self, volume_factor): #WD
1140        """ Set the Volume-Voice."""
1141        ##logging.debug('amixer sset PCM ' + str(volume_factor * 5 + 50) + '%')
1142        ##logging.debug('amixer sset Headphone ' + str(volume_factor * 5 + 50) + '%')
1143        logging.debug('amixer sset Master ' + str(volume_factor * 5 + 50) + '%')
1144        ##os.system('amixer sset PCM ' + str(volume_factor * 5 + 50) + '%')
1145        ##os.system('amixer sset Headphone ' + str(volume_factor * 5 + 50) + '%') ## BUSTER Fix
1146        os.system('amixer sset Master ' + str(volume_factor * 5 + 50) + '%') ## PulseAudio Fix for DGTPi -RR
1147        return

I will uncomment lines 1142 & 1145 and comment out lines 1143 & 1146. In your case (and probably others), I'm not sure reverting to 'Headphone' will work for you as my images are targeting a DGTPi with a speaker connected to the audio jack. You will need to figure out which audio controller is used in your setup (bluetooth?). You can use the graphical alsamixer program on the command line:

alsamixer

Then use F6 and the L/R arrow keys (if necessary) to select an output, and up/down arrow keys to adjust the volume. If you do this while PicoChess is running, you can use the web server interface to make some sounds by selecting the PicoTutor/PicoWatcher menu and just press >> a couple more times to hear the speech. Or, from another terminal window just enter the command (e.g.):

play /opt/picochess/talker/voices/en/christina/picotutor_enabled.ogg

Once you find the control that adjusts the sound with the up/down arrows, replace the word Master in the lines above with the name listed directly under the vertical volume bar that you adjusted. It must be spelled exactly as shown. Don't forget the space after the name. Also, if the control name has spaces in it, enclose it in double quotes (e.g., 'amixer sset "my contoller" ').

I hope this helps.

Randy

RandyR

unread,
Mar 17, 2021, 2:03:09 PM3/17/21
to PicoChess
I have updated the Lite image.

Randy

On Wednesday, March 17, 2021 at 9:22:10 AM UTC-5 Hansi wrote:

Hansi

unread,
Mar 17, 2021, 5:01:44 PM3/17/21
to PicoChess
Thank you Randy. It works quite fine now! I also use the audio jack with a small speaker without volume control. The bluetooth transmitter I use there for connecting a wireless earbud is also without volume control. So now I can change volume without turning on the computer :-). 

Is it possible for the next lite image update, to include the voice normalizing for German Christina you gave me last time with the vorbisgain workaround? Maybe there is a way, to normalize all the voices in the DGTPI? I guess the Tutor voice is the master voice. It is the loudest one. 

Would be nice but not a must have, just a question from a "DGTPI-Rookie" :-).

RandyR

unread,
Mar 17, 2021, 7:39:01 PM3/17/21
to PicoChess
All,

I have normalized all the voices, by folder, for both the Lite and Desktop images. The images are uploaded. If you just want the voices folder you can download it here (60 MB) for the next 30 days. You should backup the voices folder just in case you need/want to go back to original:

sudo service picochess stop
cd /opt/picochess/talker
sudo mv voices voices_bak

Copy the new voices folder into /opt/picochess/talker. Also, check that owner:group is set to root (it should be if you copied the folder here because you would need sudo). But if not:

cd /opt/picochess/talker
sudo chown -R root:root voices
sudo service picochess start

Or, just use the new image.

Let me know if there are any issues.

Randy

Hansi

unread,
Mar 18, 2021, 9:07:03 AM3/18/21
to PicoChess
Great work! Thank you very much!
Reply all
Reply to author
Forward
0 new messages