N.B. Some of the below was completed by #1189, but the remainder of this Epic isā¦ yet to be handled.
Also see [legacy #88](https://github.com/suttacentral/legacy-suttacentral/issues/88) for earlier definition.
------------
We should support audio on SC for the folks who want to listen to Dhamma.
There are a number of issues to be sorted here.
1. Sources
2. UI
3. Segmenting/sectioning
## 1. Sources
There are two main sources of Sutta readings in English.
1. frankk's http://audtip.dx.am/
2. David Gilbert's https://www.paliaudio.com/
1. Audtip has both Pali and English, and they are regularly adding new texts. The audio files are stored at archive.org, and they stream directly from there. This is great from the viewpoint of lasting and reliable sources. The suttas are read nicely, although the files tend to be a bit noisy.
2. Pali Audio has fewer texts as of now, but they are actively adding more. The file quality is better. The files are stored on dropbox and streamed from there. I'm not that confident that Dropbox will reliably do this in the long term, so I recommended to David that they also upload to archive.org.
Both of these use the usual available English translations, and are starting to use mine.
They are both mainly focussed on DN and MN, and planning to extend further.
We should host the files ourselves, so we can control the URLs and so on. There aren't too many files so it should be not too hard. Anyway, multiple copies are always good!
- **Stream from both audtip and paliaudio, but serve them ourselves.**
## 2. UI
### On SC
Best to add this to the suttaplex card. There are several kinds of implementations that one can see in the wild:
- https://coloradoencyclopedia.org/article/barney-ford
- Here they have the simplest possible UI, just click to play, click to pause. No progress indicator, and refresh page to go back to the start!
- https://www.bible.com/bible
- Quite a slick implementaion. There's a speaker icon, click it and there's a popup overlay. This gives rich info, such as edition, copyright, and various audio controls. One nifty thing, if you start the audio and close the dialog, the progress is indicated by a circle around the speaker icon.
- https://www.biblegateway.com/passage/?search=Genesis1:1-2:10&version=NIV
- Opens audio in a popup window (!) with rich info
- https://www.lds.org/scriptures/ot/gen/1?lang=eng
- Odd UI, uses headphones rather than speaker, and the audio dialog is opened in-page rather than popup (which I like) but it is separated from the point of clicking.
For us, an extra icon in the "action row", just to the left of the "share" icon should do nicely.
- Only display when audio is available
- Click to reveal audio file(s).
- I'd like to display it by expanding the card, but this is already done with the parallels. Probably better to use a popup, although I don't really like it.
- If it is a popup, use a progress indicator on the speaker icon!
- As for the player UI, this gives quite a nice example: https://www.webcomponents.org/element/gorork/paper-audio-player Even though it's a bit old (Polymer 1), the design is still good.
- The element stretches the full width of the card.
- The details are given inside the player. We don't need to add the title, etc. as these are already mentioned in the card. Rather, we would need:
- Name of reader.
- Name of translator
- Source
- There will typically be multiple readings for the same sutta, so just list them one after the other. Keeping all the info inside the reader, as in the element posted above, will help to keep it tidy.
- Only allow one to be played at a time!
- No autoplay!
### Podcasting
This is an extremely common and simple way for people to consume audio. Essentially it streams MP3 audio via RSS feeds. We would have to syndicate our audio files to various podcasting services.
- How to do: once a week?
### Voice operated: Hey Siri, read me a sutta!
Voice operated systems are ideal for audio services. Typical uses would include driving, doing simple chores or exercise at home, and so on.
These are set up by submitting a i/o system to the various services: Alexa, Siri, Hey Google, Cortana, and so on. Most of them work in similar ways, though of course it will be somewhat different.
The first thing to do is to design a flow for voice interaction. We should probably find an experienced person for this. Then that design can be implemented for the different systems.
## 3. Segmenting/sectioning
Audtip are doing some suttas in sections, and it is possible to add them to sections of a text. In addition, their file names include the ID, so it should be possible, with a little regex magic, to automatically associate one of their files with an SC ID.
For added coolness, I wonder whether it would be possible to associate these with our segmented text. Then we could play the chanting for any sentence of the pali text.
I'm wondering whether it would be possible to use voice recognition to convert the audio to text, then fuzzy match it to the written text. Basically there'd be a text layer embedded in the audio file, a bit like you embed text in a PDF of page images to make it searchable/readable.
But this is all pretty complicated. Let's go ahead just by embedding the files are they are supplied to us, and we can get fancy later on.