duration

AVPlayer cannot resume upon Wifi drops in iOS 8

半城伤御伤魂 提交于 2019-11-30 08:34:46
问题 I'm using AVPlayer to play streaming video. When Wifi drops and later enables, I see that AVPlayer cannot resume, no matter how many times I call AVPlayer play , and its currentItem 's duration is NaN, seekableTimeRanges is empty. This is not the case for iOS 7, it resumes and plays well. The workaround I can think of is to restart the player. How to deal with this? 来源: https://stackoverflow.com/questions/28059019/avplayer-cannot-resume-upon-wifi-drops-in-ios-8

HTML5 Audio Player Duration Showing Nan

蹲街弑〆低调 提交于 2019-11-30 08:29:17
I just started to learn HTML5 and was going through HTML5 Audio player using JQuery. I coded a player with Playlist, everything works fine except the Duration with help of which my input range slider doesn't works. When I debugged I found that my duration is showing me NAN. I am setting the duration after the song is initialized. Here is my JS code jQuery(document).ready(function() { container = $('.container'); playList = $('#playlist'); playListSong = $('#playlist li'); cover = $('.cover'); play = $('#play'); pause = $('#pause'); mute = $('#mute'); muted = $('#muted'); close = $('#close');

Adjust the length of an AudioUnit Buffer

不问归期 提交于 2019-11-30 07:55:45
my Problem concerns AudioUnits. In order to design a voicechanging App for iPhone (with Objective-C xCode) i use RemoteIO audioUnit sample from this website: http://atastypixel.com/blog/using-remoteio-audio-unit/ The audioUnit buffers are set to a length of 256 samples. For my project i need alot more (about 22050). The quoted page says that the length of the audioUnit buffers can be adjusted like this: float aBufferLength = 0.005; // In seconds AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof(aBufferLength), &aBufferLength); Now my specific question: The

R- Calculate a count of items over time using start and end dates

不羁岁月 提交于 2019-11-30 04:56:51
问题 I want to calculate a count of items over time using their Start and End dates. Some sample data START <- as.Date(c("2014-01-01", "2014-01-02","2014-01-03","2014-01-03")) END <- as.Date(c("2014-01-04", "2014-01-03","2014-01-03","2014-01-04")) df <- data.frame(START,END) df gives START END 1 2014-01-01 2014-01-04 2 2014-01-02 2014-01-03 3 2014-01-03 2014-01-03 4 2014-01-03 2014-01-04 A table showing a count of these items across time (based on their Start and End times) is as follows: DATETIME

Changing the iOS keyboard animation time

℡╲_俬逩灬. 提交于 2019-11-30 03:51:43
问题 Is there a way to change the time the iOS keyboard animation takes? 回答1: I've actually found a better solution. What you can do is programmatically make the textfield or textview a first responder within an animation with duration of your choice. Example for making the keyboard emerge over the course of one second might be: [UIView animateWithDuration:1.0 animations:^ { [myTextField becomeFirstResponder]; }]; Similarly, you can make the keyboard disappear like this: [UIView

Using Lua to format 0 seconds as 00:00:00

流过昼夜 提交于 2019-11-30 03:44:07
问题 I'm trying to format a duration (in seconds) as a time and I'm getting results indicating that I'm supposed to account for an epoch somewhere. I expected os.date("%X", 0) to produce "00:00:00" but it is returning "20:00:00" as well as a date value of "12/31/69" (I don't need a calendar date though). Is there a standard way of getting a time duration string that causes 0 seconds to produce a clock representing a total of zero seconds? I can't seem to find an example anywhere of what I'm trying

What are exact requirements on automatic storage duration?

瘦欲@ 提交于 2019-11-30 01:46:19
问题 Depending on the compiler the following code: int main() { srand( 0 ); if( rand() ) { char buffer[600 * 1024] = {}; printf( buffer ); } else { char buffer[500 * 1024] = {}; printf( buffer ); } return 0; } when ran on a system with maximum stack size equal to 1 megabyte either prints an empty string or crashes with a stack overflow. The difference is because different compilers allocate automatic storage differently. Most compilers allocate storage for all objects on function start, so in the

Convert JodaTime duration to string

僤鯓⒐⒋嵵緔 提交于 2019-11-30 00:57:55
问题 I have movie with duration 127 seconds. I wanna display it as 02:07 . What is the best way to implement this? 回答1: Duration yourDuration = //... Period period = yourDuration.toPeriod(); PeriodFormatter minutesAndSeconds = new PeriodFormatterBuilder() .printZeroAlways() .appendMinutes() .appendSeparator(":") .appendSeconds() .toFormatter(); String result = minutesAndSeconds.print(period); 回答2: I wanted this for myself and I did not find llyas answer to be accurate. I want to have a counter and

get duration of audio file

我怕爱的太早我们不能终老 提交于 2019-11-29 20:43:03
I have made a voice recorder app, and I want to show the duration of the recordings in a listview. I save the recordings like this: MediaRecorder recorder = new MediaRecorder(); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); folder = new File(Environment.getExternalStorageDirectory() + File.separator + "Audio recordings"); String[] files = folder.list(); int number = files.length + 1; String filename = "AudioSample" + number + ".mp3"; File output = new File(Environment.getExternalStorageDirectory() + File.separator +

How to get the duration of an audio file in iOS?

人走茶凉 提交于 2019-11-29 19:36:26
NSDictionary* fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filename error:nil] From the file attribute keys, you can get the date, size, etc. But how do you get the duration? In the 'File Attribute Keys' of the NSFileManager class reference you can see that there is no key to use that will return the duration of a song. All the information that the NSFileManager instance gets about a file is to do with the properties of the actual file itself within the operating system, such as its file-size. The NSFileManager doesn't actually interpret the file. In order to get the