playback

How to record the user voice in Objective-C for iPhone

余生长醉 提交于 2019-12-19 04:10:05
问题 I want to record the user voice and then play it back after some time. Is there any way to do this in Objective-C for iPhone? 回答1: Use AVAudioRecorder for doing this. For more help see this tutorial. Hope this helps. 来源: https://stackoverflow.com/questions/1978698/how-to-record-the-user-voice-in-objective-c-for-iphone

Playing MP3 files with Python

泄露秘密 提交于 2019-12-19 01:13:36
问题 I'm trying to write my own media player (like Foobar), and I'm having trouble tracking down a Python library that'll play MP3s. I know Pymedia does mp3s, but it looks outdated - the latest installer is for Python version 2.4, and I'm using 2.6. I've never had much success with Pygame, and Pyglet doesn't look like it has too much in the way of documentation. Are there any other alternatives? 回答1: There is http://pyglet.org/ and also have you tried http://code.google.com/p/mp3play/? It's also

Fade Between Two Music Tracks in-progress in Pygame

折月煮酒 提交于 2019-12-18 13:33:19
问题 My intention is to have two music tracks , which are similar in nature, fade between each other at various times. When such a fade occurs, one music track should fade from full volume to muted in a short period of time, and, simultaneously, the other track should fade from 0 to 100 and continue playing from the same time index . They must be able to do this dynamically at any time - when a certain action occurs, the fade will occur and the new track will start playing at the same position

HTML5 Audio and jQuery

泄露秘密 提交于 2019-12-18 12:14:33
问题 I am trying to use a button to start a track in an HTML5 audio tag using jQuery, but I keep getting an error. var song = $('#audio'); $('#play').click(function() { song.play(); }); When I use document.getElementById('audio'), it works, but when using the jQuery selector I get the following error: Uncaught TypeError: Object [object Object] has no method 'play' Thanks for any help. 回答1: Try getting the native DOM element as jQuery knows nothing about .play method on the wrapped array returned

HTML5 Audio and jQuery

寵の児 提交于 2019-12-18 12:14:31
问题 I am trying to use a button to start a track in an HTML5 audio tag using jQuery, but I keep getting an error. var song = $('#audio'); $('#play').click(function() { song.play(); }); When I use document.getElementById('audio'), it works, but when using the jQuery selector I get the following error: Uncaught TypeError: Object [object Object] has no method 'play' Thanks for any help. 回答1: Try getting the native DOM element as jQuery knows nothing about .play method on the wrapped array returned

How can I start a flash video from javascript?

纵然是瞬间 提交于 2019-12-18 09:19:41
问题 Is it possible to start playing a file inside a flash player by making use of javascript code? If so, how would I do it? 回答1: Try using swfObject, you can make any actionscript function visible for javascript using ExternalInterface and declaring them into javascript. So you can trigger actionscript function with play() (or any other code you want) from your javascript code. Here is an example: Actionscript: import flash.external.ExternalInterface; ExternalInterface.addCallback( "methodName",

Youtube iFrame API setPlaybackQuality ignored on mobile device

允我心安 提交于 2019-12-18 03:22:09
问题 I'm trying to setup YouTube iframe API to play a FullHD video with a lower quality. My goal is to save bandwidth on mobile devices and reduce loading time. My HTML structure is the classical player div, plus a debug div for messages. HTML <div id="debug"></div> <div id="your_video_id"> <div id="player"></div> </div> I've tried to invoke setPlaybackQuality as soon as the player is ready, to avoid mobile users wasting time in buffering (as suggested in this post). I've also invoked it in both

How to play video from NSData

女生的网名这么多〃 提交于 2019-12-18 02:49:25
问题 I would like to know if it's possible to play a video from an NSData object... with the MPMoviePlayerController. 回答1: Ben's answer works perfectly on simulator but wont work on the device, You cannot write anywhere on the device. Check code below NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"myMove.mp4"]; [videoData

Sound in batch?

风流意气都作罢 提交于 2019-12-17 20:12:11
问题 I am making a game in batch, and I want to play music while the player is 'battling'. I managed to play the music, but I can't seem to stop the music once the player is done with the battle. @echo off set "file=BattleMusic.mp3" ( echo Set Sound = CreateObject("WMPlayer.OCX.7"^) echo Sound.URL = "%file%" echo Sound.Controls.play echo do while Sound.currentmedia.duration = 0 echo wscript.sleep 100 echo loop echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs start /min

How to change the speed of video playback

别来无恙 提交于 2019-12-17 19:57:07
问题 I'm wondering if it's possible to change the video playback speed in an iphone application. we want users to yell in the microphone to speed up the playback and get to the end. 回答1: You have to use setCurrentPlaybackRate: 回答2: There is a rate property for the AVPlayer . If you take the example from Apple called "avPlayerDemo" in the resource section, you then simply have to set the mplayer.rate . It worked for me, I created a new slider in the xib files, implemented that slider in the