Explorar el Código

fix(mobile): format of recorder audio file

charlie hace 3 años
padre
commit
65e77e6523
Se han modificado 4 ficheros con 8 adiciones y 7 borrados
  1. 1 1
      package.json
  2. 2 1
      src/main/frontend/fs/capacitor_fs.cljs
  3. 1 1
      src/main/frontend/mobile/record.cljs
  4. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -97,7 +97,7 @@
         "@tippyjs/react": "4.2.5",
         "aes-js": "3.1.2",
         "bignumber.js": "^9.0.2",
-        "capacitor-voice-recorder": "2.1.0",
+        "capacitor-voice-recorder": "4.0.0",
         "check-password-strength": "2.0.7",
         "chokidar": "3.5.1",
         "chrono-node": "2.2.4",

+ 2 - 1
src/main/frontend/fs/capacitor_fs.cljs

@@ -226,7 +226,8 @@
                        (str "file://" (js/encodeURI dir)))
                      dir)
         path       (some-> path (string/replace #"^/+" ""))
-        encode-url #(let [encoded-chars? (boolean (re-find #"(?i)%[0-9a-f]{2}" path))]
+        encode-url #(let [encoded-chars?
+                          (and (string? %) (boolean (re-find #"(?i)%[0-9a-f]{2}" %)))]
                       (cond-> %
                         (not encoded-chars?)
                         (js/encodeURI path)))]

+ 1 - 1
src/main/frontend/mobile/record.cljs

@@ -44,7 +44,7 @@
 
 (defn- embed-audio [database64]
   (p/let [page (or (state/get-current-page) (string/lower-case (date/journal-name)))
-          filename (str (date/get-date-time-string-2) ".m4a")
+          filename (str (date/get-date-time-string-2) ".aac")
           edit-block (state/get-edit-block)
           format (or (:block/format edit-block) (db/get-page-format page))
           path (editor-handler/get-asset-path filename)

+ 4 - 4
yarn.lock

@@ -1599,10 +1599,10 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001370:
   resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001393.tgz#1aa161e24fe6af2e2ccda000fc2b94be0b0db356"
   integrity sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA==
 
-capacitor-voice-recorder@2.1.0:
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/capacitor-voice-recorder/-/capacitor-voice-recorder-2.1.0.tgz#142e7bfa62e88530279f478b79735a0dc68a7d1a"
-  integrity sha512-H0c/sUVD7cduVS5VqutKk00whyqXZUFi56ChRMl9Ke/LBU71HhHwzonPmheT8i9gQmgOaplc3TOpaKqckXb+3A==
+capacitor-voice-recorder@4.0.0:
+  version "4.0.0"
+  resolved "https://registry.yarnpkg.com/capacitor-voice-recorder/-/capacitor-voice-recorder-4.0.0.tgz#41939aa21e68eb58301e781c217ad17dd48d2a34"
+  integrity sha512-J5RfSOnTFm0nOJlW46wSNUVY331SHF0jGc+pi5X0/6NsNM6tJPhZtg4dajIY0zPRR94eirE3Z/h6R+RW3EmSQg==
   dependencies:
     get-blob-duration "^1.2.0"