Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support audio files #2224

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

aldosolorzano
Copy link

@aldosolorzano aldosolorzano commented Jun 17, 2022

Description

My intent with this PR is to bring a basic support for audio files to athens.

Solution

So far this is what I have;

  • Copy the audio file from the drag and drop event and move it to the athens folder.
  • I chose the text ^[]() to be used to represent an audio file so that the interpreter can render the audio view correctly.
    Screenshot from 2022-06-17 14-32-40

Problems

  1. Have a specific folder for audio files and to re-use the images folder.
  2. Render a simple component view to be able to play and pause the audio file.
  3. As audio files are larger than images, I don't know if it will impact the search engine. Probably not as the search engine only looks for text
  4. Uploading heavy to the cloud will be a challenge

@CLAassistant
Copy link

CLAassistant commented Jun 17, 2022

CLA assistant check
All committers have signed the CLA.

@vercel
Copy link

vercel bot commented Jun 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
athens ✅ Ready (Inspect) Visit Preview Jun 17, 2022 at 3:05PM (UTC)

@vercel
Copy link

vercel bot commented Jun 17, 2022

Deployment failed with the following error:

Invalid request: `target` should be string.

@@ -265,6 +265,12 @@
:borderRadius "md"
:alt alt
:src url}])
:url-audio (fn [{url :src alt :alt}]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not working, dunno how if chakra ui supports audio

@@ -70,6 +71,7 @@
:id base-dir
:base-dir base-dir
:images-dir (.resolve (path) base-dir IMAGES-DIR-NAME)
:audios-dir (.resolve (path) base-dir AUDIOS-DIR-NAME)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with this change, when I tried to access to :audios-dir it returns nil

[athens.electron.utils :as electron.utils]
[re-frame.core :as rf]))

(defn save-audio
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the save-image function share a big portion of code, maybe makes sense to refactor the common code to copy files

@@ -98,6 +99,7 @@ strikethrough = <#'~~(?!\\s)'>

link = md-link
image = <'!'> md-link
audio = <'^'> md-link
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did some copy and paste, but I don't fully understand how the interpreter works

@tangjeff0
Copy link
Collaborator

Hi @aldosolorzano, thank you so much for the PR! Some questions around this:

  • We think we will move away from markdown syntax eventually to be more rich-text. I'm not sure if we want to support more syntax like ^[](), which is not really standard in markdown.
  • I wasn't able to see anything rendered when I linked to an audio file. What kind of UI did you want to present?
  • Random question: what kind of audio files did you want to link to in Athens?

@aldosolorzano
Copy link
Author

Hi @aldosolorzano, thank you so much for the PR! Some questions around this:

Hi @tangjeff0 thank you for answering and sorry for taking long to reply, now I have some time to try again this.

  • We think we will move away from markdown syntax eventually to be more rich-text. I'm not sure if we want to support more syntax like ^[](), which is not really standard in markdown.

Yes agree with you, I randomly chose that syntax as I could find an standard, to what are you planning to migrate ?

  • I wasn't able to see anything rendered when I linked to an audio file. What kind of UI did you want to present?

Yes, that's the problem I had, I was able to copy the audio to the athens folder and convert it as ^[](path/to/file) when you drag the file but I cant' render it with a simple player. I tried simple html tag and it didn't work. I think that a super simple play and stop could work to test if it makes sense to have it and invest more time.

  • Random question: what kind of audio files did you want to link to in Athens?

Me and my brother like to record audio from natural places, such as ocean, woods, birds etc... and use them for research and to make music. One day I was talking to him while using athens and it clicked me, I could use athens as a way to share notes over an audio file and not send a whatsapp explaining my idea and then audio. Also as I personal log for adding ideas for the specific recordings and have a centralize place.
Probably dealing with audio can become complicated and heavy, but as an experiment I think is worth it to give it try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants