media

Phonegap Media record mp3 file corrupt

折月煮酒 提交于 2019-12-07 19:14:25
I am using phonegap media to record audio as mp3. After recording, it plays fine on my Android and plays fine on Windows Media Player. However, when I try it in the browser it says that the file is corrupt. Exact errors: Chrome: "We cannot play this audio file right now." Firefox: "Video can't be played because the file is corrupt." IE: Opens the file in WMP and it plays. I used the code from the example. http://docs.phonegap.com/en/2.6.0/cordova_media_media.md.html#media.startRecord // Record audio // function recordAudio() { var src = "myrecording.mp3"; var mediaRec = new Media(src, //

Media.release() in cordova's Media plugin

╄→гoц情女王★ 提交于 2019-12-07 18:53:14
问题 How does Media.release() work. Looking at the docs it feels that you have to use it like this: MediaService.loadMedia('sounds/connection-error.wav').then(function(media){ media.play(); media.release(); }); But I googled enough to know that is wrong. We have to explicitly release the core instances on Android. But how to do that? If I have 8 views in my app and if I play a sound file on each of those views does that count as 8 core instances being used? And can I go back to say view number 1

How to detect if speech to text is available on android?

蹲街弑〆低调 提交于 2019-12-07 14:34:08
问题 I believe I have figured out how to detect if an android device has a microphone, like so: Intent speechIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); List<ResolveInfo> speechActivities = packageManager.queryIntentActivities(speechIntent, 0); TextView micAvailView = (TextView) findViewById(R.id.mic_available_flag); if (speechActivities.size() != 0) { //we have a microphone } else { //we do not have a microphones } However, how does one detect whether the android device has

Android: Pause voice Recorder and Resume

百般思念 提交于 2019-12-07 14:07:30
问题 I've used following code as base to create a recorder. I can start and stop audio recording and it gets saved properly in the location. But now I have a requirments to pause the voice recorder How to pause the audio recorder? And resume voice recording? I've seen a voice recording appliation in my samsung galaxy Ace, it has a pause button. Can someone enlighten me. public class audio { final MediaRecorder recorder = new MediaRecorder(); final String path; /** * Creates a new audio recording

how to make style sheet for tablet and iphone

一世执手 提交于 2019-12-07 11:53:44
问题 I was thinking the link target on the stylesheet would make my css file only load when it loads on a tablet or iphone. But the elements I'm trying to hide are still there. Im currently using (media="handheld") <link rel="stylesheet" type="text/css" hrf="css/media.css" media="handheld" /> 回答1: There are too many mobile device models out there to write stylesheets for; you'd be better off adjusting your CSS based on Screen Size . This is especially helpful for targeting Android Tablets which

Web pages to print media — solutions?

会有一股神秘感。 提交于 2019-12-07 03:36:00
问题 I've been a big fan of MediaWiki and similar wiki-based text editors. I like the ability to quickly add text, collaborate, and share. However, there's always still the need for nicely formatted print output. Things like headers and footers (that say what I want them to say), page breaks, margins, etc. Most solutions I've seen involve some sort of conversion to a intermediate print-media format (maybe MediaWiki to Microsoft Word or maybe some custom scripting that generates a PDF from the

javafx UNKNOWN duration on Media object

喜夏-厌秋 提交于 2019-12-07 01:59:33
问题 I am a newbie to both Java and JavaFX, I've spent the last couple years developing on Python with QT, and I am now developing in Java and JavaFX. I am developing a program that plays music files for the users set time and then stops. Be that as such, I am in need of getting the duration from the Media Object in order to tell the audio when to stop (based on the users time input), however, the getDuration() method on a media object always returns UNKNOWN. I am using JDK8u25 (the latest stable

How do I avoid using !important?

大城市里の小女人 提交于 2019-12-07 01:46:34
问题 I am trying to make my website responsive. However, when I use another media query, a lot of things won't work. For example: (Normal CSS) div#divName { font-size:1em; } (Media query code) @media screen and (max-width: 320px) { div#divName { font-size:.5em; } } This doesn't work. It only works when I use "!important" behind it. But I don't know if that is correct or "wrong". Could anyone tell me how I can fix this? 回答1: All !important does is increase specificity. To avoid using !important ,

Safari blocks play() on video despite being called from click event

落花浮王杯 提交于 2019-12-06 23:33:32
问题 I'm creating some custom video controls for an html5 element. I've bound a click event handler to a play/pause button which calls .play() on the corresponding video. From my research, Safari will block calls to .play() unless you are in a click handler, however it is blocking my calls to .play() despite the fact that I am triggering it from within a click handler, like so: $('.video-container .play-pause').click(function(event){ var $video = $(event.currentTarget).parent().find('video'); if(

Recording audio from multiple microphones simultaneously with getUserMedia()

本秂侑毒 提交于 2019-12-06 21:50:48
问题 it is possible to access different microphones at the same time using getUserMedia() ? This whould be useful to filter out background noise; create some sort of stereoscopic effect; make available multiple audio tracks for an international streaming conference. Apparently, it is quite tricky for video source: Capture video from several webcams with getUserMedia I was wondering if, for the audio source, the problem was different. 回答1: You should be able to do this but I imagine the browser