# Voice Recorder Component

**URL:** https://meta.discourse.org/t/voice-recorder-component/215621
**Category:** Theme component
**Tags:** pavilion
**Created:** [January 22, 2022, 8:43am UTC](https://meta.discourse.org/t/voice-recorder-component/215621 "2022-01-22T08:43:42Z")
**Posts on this page:** 20
**Page:** 5

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 23, 2024, 6:59pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/86 "2024-04-23T18:59:06Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/e/3/e/e3e1b79b9cbc1bd994c43b3634f6cb3033087d72.png)

Like that! Make sure you’re using the URL I gave you. 👍

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [April 23, 2024, 8:23pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/88 "2024-04-23T20:23:11Z")

</div>

Here are my [before](https://noobish.me/t/voice-recorder-tc-test-debugging/602) and [after](https://noobish.me/t/voice-recorder-tc-test-debugging/602/2) results:

(Also note that the only embedded .mp3 player _ **not showing** _ the length of time for the clip is the one recorded on Windows, both before and after.)

### BEFORE:

 ![voice-recorder-tc-paviliondev-before](https://global.discourse-cdn.com/meta/original/4X/1/e/1/1e18e0d7a2494931d389d17128d8dbbdf19eeab5.png)

### AFTER:

 ![voice-recorder-tc-arkshine-1](https://global.discourse-cdn.com/meta/original/4X/0/e/f/0ef1adca6e40f181871d340e74672e13c5090832.png)

> ### Let me know if you’d like me to do any more tests!

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [April 24, 2024, 6:01am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/89 "2024-04-24T06:01:28Z")

</div>

It works for me using iPad and iPhone, on DiscourseHub too. Lenght of a clip shows up when playing.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 24, 2024, 3:10pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/90 "2024-04-24T15:10:32Z")

</div>

Thanks for the feedback, Jakke!

Also, thanks to @denvergeeks, I fixed two issues, and he confirmed that everything now plays perfectly.

I’m going to PR soon. 👍

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 24, 2024, 10:41pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/91 "2024-04-24T22:41:45Z")

</div>

I made the PR 👍

[https://github.com/paviliondev/discourse-voice-recorder/pull/6](https://github.com/paviliondev/discourse-voice-recorder/pull/6)

Possible features for other PRs:

- Add support for chat
- Add support for pause/resume

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [April 24, 2024, 10:45pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/92 "2024-04-24T22:45:07Z")

</div>

Such awesomeness

![](https://media.tenor.com/qbd37oenwB0AAAAC/grilla-yes.gif)

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [April 25, 2024, 2:34am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/93 "2024-04-25T02:34:48Z")

</div>

Here’s a crazy thought – an AI Transcription Button for uploaded .mp3 audio files in the composer? That way a user could (now) record a post in the composer, and also make it text-readable and searchable.

What would it take to include the OpenAI/Whisper capability?

[https://github.com/openai/whisper](https://github.com/openai/whisper)

 ![Screenshot 2024-04-24 203028](https://global.discourse-cdn.com/meta/original/4X/7/c/b/7cbaa268423974c125d4dc5da06bea6d62f3f359.png)

Or, in the AI dropdown options which appear upon selecting the file in the composer…

 ![Screenshot 2024-04-24 203951](https://global.discourse-cdn.com/meta/original/4X/4/a/0/4a01464a660efc2f955c052aecd5a3c13d959188.png)

…could include a _Transcribe Text_ option

 ![Screenshot 2024-04-24 204128](https://global.discourse-cdn.com/meta/original/4X/4/7/a/47a62cd438095b40ccfa210512d501740f63589d.png)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 25, 2024, 3:08am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/94 "2024-04-25T03:08:38Z")

</div>

That would be an interesting and helpful feature! 👍

I will check the feasibility another day.

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [April 25, 2024, 11:06pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/95 "2024-04-25T23:06:00Z")

</div>

> [@Arkshine](#):
>
> Add support for chat

Highly appreciated on this one !

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [April 25, 2024, 11:12pm UTC](https://meta.discourse.org/t/voice-recorder-component/215621/96 "2024-04-25T23:12:18Z")

</div>

If implemented in Chat, then inline auto-transcribing could also include translations.

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [April 26, 2024, 12:30am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/97 "2024-04-26T00:30:33Z")

</div>

I updated this component in the system.  
`https://github.com/paviliondev/discourse-voice-recorder`

tried on firefox/safari/chrome on mac, and iphone  
it shows this, it does not record.  
could someone confirm, thanks…

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/9/1/c91a94e9961b65a26613de2e6a20ec4662efeda2.png)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 26, 2024, 12:47am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/98 "2024-04-26T00:47:50Z")

</div>

Can you check the browser’s console if you see errors?

At this point, it means something is blocking the library script loading.

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [April 26, 2024, 12:53am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/99 "2024-04-26T00:53:44Z")

</div>

I just freshly installed the TC from the paviliondev repository as linked above.

Everything is working in my Discourse instance. Here is a video…

(And no errors appear in the console at any step of creating/uploading/playing.)

[![](https://global.discourse-cdn.com/meta/original/4X/a/7/d/a7d10304b4189e19ab17d1ebd0c56295dc08082f.jpeg "New Recording - 4/25/2024, 6:50:01 PM") ](https://vimeo.com/939378422)

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [April 26, 2024, 12:57am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/100 "2024-04-26T00:57:19Z")

</div>

this is discourse 3.2.1 hosted on communiteq

load-script.js:43 Refused to load the script ‘[https://www.mydiscoursesite.com/uploads/db9860/original/3X/c/f/cf579d0503105d41f84653929d510e17f12d9f5b.js](https://www.mydiscoursesite.com/uploads/db9860/original/3X/c/f/cf579d0503105d41f84653929d510e17f12d9f5b.js)’ because it violates the following Content Security Policy directive:  
"script-src  
[https://www.mydiscoursesite.com/logs/](https://www.mydiscoursesite.com/logs/)  
[https://www.mydiscoursesite.com/sidekiq/](https://www.mydiscoursesite.com/sidekiq/)  
[https://www.mydiscoursesite.com/mini-profiler-resources/](https://www.mydiscoursesite.com/mini-profiler-resources/)  
[https://www.mydiscoursesite.com/assets/](https://www.mydiscoursesite.com/assets/)  
[https://www.mydiscoursesite.com/extra-locales/](https://www.mydiscoursesite.com/extra-locales/)  
[https://www.mydiscoursesite.com/highlight-js/](https://www.mydiscoursesite.com/highlight-js/)  
[https://www.mydiscoursesite.com/javascripts/](https://www.mydiscoursesite.com/javascripts/)  
[https://www.mydiscoursesite.com/plugins/](https://www.mydiscoursesite.com/plugins/)  
[https://www.mydiscoursesite.com/theme-javascripts/](https://www.mydiscoursesite.com/theme-javascripts/)  
[https://www.mydiscoursesite.com/svg-sprite/](https://www.mydiscoursesite.com/svg-sprite/)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 26, 2024, 1:43am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/101 "2024-04-26T01:43:19Z")

</div>

I can reproduce.

A recently introduced setting allows external scripts to run dynamically without manual configuration.  
It’s not available in 3.2.

![image](https://global.discourse-cdn.com/meta/original/4X/a/a/7/aa78b05faed37c93f9b092820c937c33fe8a80b8.png)

it’s definitively not a good idea to allow the “_/uploads_” directory.  
However, as a workaround, allowing only the URLs should be okay.

If you go to the component settings:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/9/5/d952c6daf05adc86ee6c26838f1135f52402ef53.png)

You can right-click on each link to copy and paste them to the `content security policy script-src` setting.

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/f/3/6f3c11a01338817e5156fec094e75134e086e78e.png)

I don’t know if there is a better way to handle the CSP issue here from a theme component. 🤔

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [April 26, 2024, 2:17am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/102 "2024-04-26T02:17:32Z")

</div>

thanks @Arkshine

in the console, I saw these 2 js in /uploads/ url, and added to the list of “content security policy script src”

`https://www.site.com/uploads/db9860/original/3X/c/f/cf579d0503105d41f84653929d510e17f12d9f5b.js`  
`https://www.site.com/uploads/db9860/original/3X/a/2/a25eb4ec6c9652e57eefc81bc25c81105232369b.js`

confirmed the browser permission for recording.  
then, everytime when start a recording, it gets the error with a different url, seems the id is generated on the fly ?

`https://www.site.com/8f955841-9b8b-4857-8549-ac57ee0e4517`  
`https://www.site.com/d43014ac-e80d-4879-83a2-bd046d43a25c`  
…  
adding these url does not help, seems it is generated for each recording… ?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 26, 2024, 2:21am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/103 "2024-04-26T02:21:57Z")

</div>

Can try to add `script-src: blob:` in `content security policy script-src`, too, please?

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/9/2/9923eb6d4c1cc9b275713064db9bb6445f207060.png)

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [April 26, 2024, 2:49am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/104 "2024-04-26T02:49:51Z")

</div>

it works, thanks @Arkshine !

looking forward to the voice-recording in chat 🙂

---

<div class="post-metadata">

### Author: ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)
#### Post date: [April 26, 2024, 3:32am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/105 "2024-04-26T03:32:14Z")

</div>

I didn’t have this error, apparently because I already had **blob:** as an entry in **content security policy script src** because @peter.be’s [plugin](https://meta.discourse.org/t/discourse-audio-message/270432) had required it and since removing that plugin I had not removed **blob:** as an entry in **content security policy script src** , so it was already there, as below…

 ![Screenshot 2024-04-25 212641](https://global.discourse-cdn.com/meta/original/4X/d/0/0/d00c5fa860d377943f0d064743dbe7e09eab7f7a.png)

Is it also required to add `mp3` to the authorized extensions list in the Discourse admin settings? I also have that already from before as well…

 ![Screenshot 2024-04-25 213558](https://global.discourse-cdn.com/meta/original/4X/d/5/e/d5e1370773dd7377f200f192cb4c83188c55bf4c.png)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [April 26, 2024, 8:50am UTC](https://meta.discourse.org/t/voice-recorder-component/215621/106 "2024-04-26T08:50:04Z")

</div>

Just to think about: CSP has tendency break things badly, and because of that it is quite usual to use rules that are practically just wildcards — and then CSP looses its idea totally.

So?

[Previous page](https://meta.discourse.org/t/voice-recorder-component/215621.md?page=4)

[Next page](https://meta.discourse.org/t/voice-recorder-component/215621.md?page=6)
