I am using cordova-plugin-media to record voice(with pause and resume features) in my ionic app for android. After I record it I need to get base64 string in order to play it using html audio tag. And the problem is: if I am trying to save recording which was paused and resumed as 3gp file('voice.3gp'), then when I use readAsDataURL method of cordova-plugin-file, I don't receive anything(the callback simply not called). If I am trying to save it as mp3 or wav file, then I receive only 1st part of the recording(before pause). I suppose that the proper audio file extension should be 3gp as this extension is used in the implementation of 'cordova-plugin-media' but then I have problems with playing this file using html audio tag. Any help is appriciated
Ionic 3 get base64 audio string from recorded file
2.4k views Asked by Jack At
3
There are 3 answers
0
Gonzalo Carmenado
On
Read this:https://ionicframework.com/docs/v3/native/base64/
It is the oficial website API of ionic. Just install that plugin and use this:
this.base64.encodeFile(this.filePath + this.fileName).then(
(base64:any) =>{
console.log('file base64 encoding: ' + base64);
});
In this post, i explain it better. I let the link here: convert audio file to base64 in ionic 3
Related Questions in IONIC-FRAMEWORK
- Firebase link existing user to anonymous account?
- Ionic Angular Standalone ion-icon are not showing at all
- Unable to run ionic app on Android emulator - [error] ADBs is unresponsive after 5000ms
- How should I filter Observables the "Right Way" with RxJs in Angular 17?
- Ionic/Capacitor: Background Location Tracking on iOS and Android?
- Best Approach for Implementing Video Selection from Gallery/Files in Ionic-React with Capacitor
- <video> tag with downloaded path in ionic ios not loads the video
- How do I record that this ionic checkbox has been checked by the user?
- Ionic 5 angular sharing a component between two modules
- mergeDebugResources FAILED
- Issue saving generated image to local filesystem in iOS using Capacitor
- Detect clickable areas within <img> tag in Ionic project
- Whitelisting Ionic app in Salesforce Org for CORS/CSP
- How to Polyfill node core modules in webpack 5 using ionic capacitor angular
- I'm developing an Android, but I can't see my "console.log" in logcat
Related Questions in BASE64
- How to use custom font during html to pdf conversion?
- Converting img src data to octet-stream
- System.FormatException: Entry is not valid Base64 string
- GitLab "Upload a File" API returns "file is invalid" after POST
- Adding a reset button for my digital signature
- I have a problem with decoding from base64
- Facing decryption error while decrypting encrypted payload using RSA Cipher Algorithm for GST and E-Way Bill authentication
- Base 64 : Illegal base64 character 3 Exception
- Media Recorder API encoding audio/mp4 stream to base64 string
- React Native preview Base64 encoded files
- Decoding base64 img in react getting error
- Trouble with HMAC Signature Verification Between Go and PHP for Encrypted URL
- How to read a .bin file and display the extact content of it in a table cell?
- Unable to decrypt Zoom AppContext - InvalidTag Error
- I cannot get Gmail to Base64decode correctly
Related Questions in CORDOVA-PLUGINS
- cordova-background-geolocation-plugin don't giving any response in cordova android app
- Failed imports in ionic plugin
- android.content.ActivityNotFoundException: No Activity found to handle null
- httpd plugin in ionic capacitorJS
- Connecting Custom Cordova Plugin in Native vue app
- processReleaseMainManifest FAILED when build in cordova 12.0.0
- After installing cordova-plugin-screen-orientation npx cap sync does not work anymore
- download PDF file from external website with inappbrowser ionic cordova
- From @awesome-cordova-plugins/in-app-browser not able to download PDF in Ionic Cordova Applications
- Using NFC scanning functionality in React apps with Capacitor
- How to disable log output in Cordova apps
- cordova my height body got shrink after keyboard pop up
- Unable to do payment in angular cordova app from android device
- SAPUI5 Bundled app w/ Cordova SSO SAP Backend
- TypeError: Spread syntac requires ...iterable[Symbol.iterator] to be a function
Related Questions in CORDOVA-PLUGIN-FILE
- Cordova iOS cannot read files with extended characters
- Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided
- Cordova File Plugin: Write/Read written files after app is reinstalled (android)
- cordova-plugin-file not uploading cdvfile:// path to the server
- How to read choosen file content in Cordova app?
- How to find and open images? using cordova-plugin-file
- Display image from internal storage in Vue + Cordova
- Cordova, I can use a file remotely but not locally, what am I wrong?
- How to save dynamic files accessible to the user?
- Save document cordova android android ios ionic angular
- this.file.listDir won't return folders under the externalRootDirectory on Android
- Cordova - how to save an image to iOS photo gallery?
- IONIC: File size getting increasing after copying file from internal storage to application directory using file plugin
- iOS: app will not open without cordova-plugin-file-transfer
- Cannot create directory with Cordova file plugin
Related Questions in 3GP
- Issue with repairing 3GP video using untrunc - Error: bad track: 's263'
- How to convert a WAV file into a 3gp in Android using MediaCodec
- Has anyone overcome low-quality issues with .3gpp?
- 3gp file not playing audio in chrome
- How to build ffmpeg to get the smallest static library? I only want convert 3gp to mp4
- 3GP video with "jpeg" video codec
- Write .3gp file into .wav format python Flask server
- difference between "enum" and "choice" type in ASN1
- 3GPP Cell ID and Cell Type
- Problems saved as 3gp files when screen recording on Android9
- How to receive 3gp file from android and decode it using python?
- How to upload audio (3gp) file to firebase storage?
- How to programatically download a video?
- Fixing a corrupted .MP4 file. which might be a 3gp file
- Convert 3gp files to Ogg Vorbis?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
okay, I just found out that you can use method "resolveLocalFilesystemUrl" of the cordova-plugin-file which will return you the object and inside this object there is a property "nativeURL" which can be used as a source(src) for the video tag(had to video tag instead of audio because 3gp format is actually for video)