emj365 / yinlang-training-ionic

0 stars 0 forks source link

investigate recording in ionic #1

Open emj365 opened 9 years ago

emj365 commented 9 years ago

There is discuss in ionic forum about recording: http://forum.ionicframework.com/t/record-audio-compress-convert-and-upload/4100

emj365 commented 9 years ago

Found a Cordova plugin to do that: http://plugins.cordova.io/#/package/org.apache.cordova.media-capture http://cordova.apache.org/docs/en/2.4.0/cordova_media_capture_capture.md.html#capture.captureAudio

But that will show a native recording UI. User need starts and submits recording manually.

Others I can find but don't know how to make those work: https://github.com/voicekick/cordova-plugin-microphone https://github.com/CirrusTech/cordova-audiorecorder-plugin

emj365 commented 9 years ago

http://stackoverflow.com/questions/9371479/voice-record-on-mobile-web-application

Good question but no answer.

emj365 commented 9 years ago

https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-audioCapture It can use getUserMedia API through Android CrossWalk.

emj365 commented 9 years ago

https://github.com/CirrusTech/cordova-audiorecorder-plugin This will work like API.

Create our own plugin as recorder:

iOS or Android >> wave >> JS >> mp3 mp3 >> WebView >> audiotag >> iOS or Android

Encode mp3 in JS, resources: https://github.com/akrennmair/libmp3lame-js https://github.com/akrennmair/speech-to-server

emj365 commented 9 years ago

References

Recording format support in native:

iOS: http://stackoverflow.com/questions/7279643/record-audio-on-iphone-with-smallest-file-size Android: http://developer.android.com/guide/appendix/media-formats.html

Audio format support in browser:

http://stackoverflow.com/questions/15568884/how-can-i-use-html5-audio-tag-to-play-aac-file

Solution:

Desktop browser

Tool:

Record:

WAV > MP3 > Base64 MP3 > upload

Playback in App:

download form server > Base64 MP3 > Base64 MP3 Player(flash) > play

Playback in SNS App:

download form server > MP3 > audio.js > play

Mobile Hybrid

Record:

AAC(in MP4) > upload > MP3

Playback:

iOS MP3 with audio tag

Android MP3 with audio tag (crosswalk)

Create Tools for the Solution: