yihui / xaringan

Presentation Ninja 幻灯忍者 · 写轮眼

Home Page:https://slides.yihui.org/xaringan/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please allow users to make a sound effect for any element for HTML slides

jooyoungseo opened this issue · comments

Hello,

xaringan is very nice tool for blind people to create presentation slides as long as they have enough knowledge about R Markdown and some CSS syntax.

I am one of the blind R users who have massively benefitted from Rmd in many areas of my professional life.
I really appreciate your hard work for rmarkdown, bookdown, blogdown, xaringan, etc.

There is no problem at all in terms of composing an Rmd-based xaringan document.

However, when I give a professional presentation using HTML slides produced by xaringan, I have to turn off my screen reading software not to bother my audience from the text-to-speech synthesizer.

As you guess, I have to memorize how many times I have to press space bar corresponding to either the number of my slides or incremental element as I cannot see the screen; this is not very ideal and sometimes I make a mistake.

I was wondering if there would be any way for you to improve xaringan to implement a sound effect towards each slide or any element like we apply CSS class properties to make some parts large or small using .large[] or .small[].

If possible, I would like to associate any sound effect file wen applying that sound property to an element so that I can recognize what appears.
Do you think it is something that can be implemented?

Appreciatively,

Thank you for sharing your experience with xaringan! I would be happy to develop a solution that fits your needs.

What kind of sound effects would be best in this situation? Do you want each slide or transition to have a different sound? I'm not sure about the feasibility of this idea, but would it make sense to mark progress through the slides by starting with a higher pitched tone and decreasing the tone for each slide?

@gadenbuie,

I sincerely appreciate your willingness to address this need! This would be instrumental for not just me alone, but also other R users with visual impairments!

My original desire was to have each slide has the same audio sound (like clicking sound) so that I can recognize a new slide pops up; however, I really love your suggested novel idea marking slide progress using audio tone!!
Would it be possible to mark progress through the slides by starting with a lower pitched tone and increasing the tone for each slide?
Again, your support would enable many people all over the world including me.
Many thanks!

That makes a lot of sense, thanks! I may not be able to get to this right away, but I'm looking forward to trying to solve this challenge and help make xaringan more accessible for all users.

@gadenbuie Thanks for volunteering! This post might be helpful in terms of playing audio with JS: https://marcgg.com/blog/2016/11/01/javascript-audio/

Once you figure that out, you can use the showSlide event to play the sound: https://github.com/gnab/remark/wiki/Configuration#events The slides object is named slideshow in xaringan:

'var slideshow = remark.create(%s);', if (length(nature)) xfun::tojson(nature) else ''

Eventually, you can include the JS code via after_body, e.g.,

output:
  xaringan::moon_reader:
    includes:
      after_body: "sound.js"

Thanks @yihui for the pointers and the link to the blog post, that looks perfect! I'll report back here if I run into any issues or when I get it working

Hi @jooyoungseo -- just wanted to let you know that I just (GitHub) released xaringanExtra. It's a little package of xaringan extensions, including adding sound effects to slides. Here's a little example: https://pkg.garrickadenbuie.com/xaringanExtra/slide-tone/

This is awesome @gadenbuie ! 🤩

Good damn, another classical Garrick 🚀

commented

@pat-s off the topic, maybe we could integrate the CSS theme thing into xaringanExtra?

@pat-s off the topic, maybe we could integrate the CSS theme thing into xaringanExtra?

Hm, we lost track on this one a bit. Not sure if it would fit there and if Garrick wants to have it there. What are your detailed thoughts on putting it there? (let's discuss this in a separate issue).

@gadenbuie, thank you so much for this development and release!

I faced installation issue so I had opened the issue on your GitHub page.

I am closing this issue because this has been implemented via xaringanExtra::use_slide_tone(). Many thanks to @gadenbuie! :)