Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

voice: Allow voice prompt volume to be configurable

It defaults to 100%, allow it to be dialed back

Change-Id: If997fb7d3057472a7fac0be4ae7d1e8fce654c49

+37 -2
+14
apps/lang/english.lang
··· 9500 9500 </voice> 9501 9501 </phrase> 9502 9502 <phrase> 9503 + id: LANG_TALK_MIXER_LEVEL 9504 + desc: Relative volume of voice prompts 9505 + user: core 9506 + <source> 9507 + *: "Voice prompt volume" 9508 + </source> 9509 + <dest> 9510 + *: "Voice prompt volume" 9511 + </dest> 9512 + <voice> 9513 + *: "Voice prompt volume" 9514 + </voice> 9515 + </phrase> 9516 + <phrase> 9503 9517 id: LANG_VOICE_FILETYPE 9504 9518 desc: voice settings menu 9505 9519 user: core
+2 -1
apps/menus/settings_menu.c
··· 709 709 MENUITEM_SETTING(talk_filetype_item, &global_settings.talk_filetype, NULL); 710 710 MENUITEM_SETTING(talk_battery_level_item, 711 711 &global_settings.talk_battery_level, NULL); 712 + MENUITEM_SETTING(talk_mixer_amp_item, &global_settings.talk_mixer_amp, NULL); 712 713 MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, Icon_Voice, 713 714 &talk_menu_item, &talk_dir_item, &talk_dir_clip_item, 714 715 &talk_file_item, &talk_file_clip_item, &talk_filetype_item, 715 - &talk_battery_level_item); 716 + &talk_battery_level_item, &talk_mixer_amp_item); 716 717 /* VOICE MENU */ 717 718 /***********************************/ 718 719
+1
apps/settings.h
··· 588 588 bool talk_file_clip; /* use file .talk clips */ 589 589 bool talk_filetype; /* say file type */ 590 590 bool talk_battery_level; 591 + int talk_mixer_amp; /* Relative volume of voices, MIX_AMP_MPUTE->MIX_AMP_UNITY */ 591 592 592 593 /* file browser sorting */ 593 594 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
+4
apps/settings_list.c
··· 61 61 #include "onplay.h" 62 62 #endif 63 63 64 + #include "voice_thread.h" 65 + 64 66 #if defined(DX50) || defined(DX90) 65 67 #include "governor-ibasso.h" 66 68 #include "usb-ibasso.h" ··· 1327 1329 "talk filetype", NULL), 1328 1330 OFFON_SETTING(F_TEMPVAR, talk_battery_level, LANG_TALK_BATTERY_LEVEL, false, 1329 1331 "Announce Battery Level", NULL), 1332 + INT_SETTING(0, talk_mixer_amp, LANG_TALK_MIXER_LEVEL, 100, 1333 + "talk mixer level", UNIT_PERCENT, 0, 100, 5, NULL, NULL, voice_set_mixer_level), 1330 1334 1331 1335 #ifdef HAVE_RECORDING 1332 1336 /* recording */
+10 -1
apps/voice_thread.c
··· 31 31 #include "pcm.h" 32 32 #include "pcm_mixer.h" 33 33 #include "codecs/libspeex/speex/speex.h" 34 + #include "settings.h" 34 35 35 36 /* Default number of PCM frames to queue - adjust as necessary per-target */ 36 37 #define VOICE_FRAMES 4 ··· 327 328 sleep(1); 328 329 } 329 330 331 + void voice_set_mixer_level(int percent) 332 + { 333 + percent *= MIX_AMP_UNITY; 334 + percent /= 100; 335 + mixer_channel_set_amplitude(PCM_MIXER_CHAN_VOICE, percent); 336 + } 337 + 330 338 /* Initialize voice thread data that must be valid upon starting and the 331 339 * setup the DSP parameters */ 332 340 static void voice_data_init(struct voice_thread_data *td) ··· 337 345 dsp_configure(td->dsp, DSP_SET_SAMPLE_DEPTH, VOICE_SAMPLE_DEPTH); 338 346 dsp_configure(td->dsp, DSP_SET_STEREO_MODE, STEREO_MONO); 339 347 340 - mixer_channel_set_amplitude(PCM_MIXER_CHAN_VOICE, MIX_AMP_UNITY); 348 + voice_set_mixer_level(global_settings.talk_mixer_amp); 349 + 341 350 voice_buf->td = td; 342 351 td->dst = NULL; 343 352 }
+2
apps/voice_thread.h
··· 38 38 void voice_thread_init(void); 39 39 void voice_thread_kill(void); 40 40 41 + void voice_set_mixer_level(int percent); 42 + 41 43 #ifdef HAVE_PRIORITY_SCHEDULING 42 44 void voice_thread_set_priority(int priority); 43 45 #endif
+4
manual/configure_rockbox/voice.tex
··· 88 88 When this option is enabled the battery level is announced when it falls 89 89 under 50\%, 30\% and 15\%. 90 90 91 + \item[Voice Volume Level.] 92 + This allows you to specify the relative volume of the voice prompts as 93 + a percentage of the main audio volume. It defaults to 100\%. 94 + 91 95 \end{description} 92 96 93 97 See \wikilink{VoiceHowto} for more details on configuring speech support in Rockbox.