buffer

HTML5 audio/video stop buffer

我的梦境 提交于 2019-12-22 13:45:15
问题 Is there a way to stop buffering in the browsers. I have an audio tag which is pointing to some mp3 file. Browsers starts buffering the audio while it is playing. Can I stop the buffering ? I know ideally if you have audio data coming in faster then what the client can play why not buffer it. What I am asking is audio player should only buffer the min amount and ask for more data. I know it is a get request so it is not really a protocol to ask more. So just consume a chunk, play it and

WCF service clear buffer

本秂侑毒 提交于 2019-12-22 13:31:42
问题 I am currently working on a WCF service and have a small issue. The service is a Polling Duplex service. I initiate data transfer through a message sent to the server. Then the server sends large packets of data back through the callback channel to the client fairly quickly. To stop the I send a message to the sever telling it do stop. Then it sends a message over the callback channel acknowledging this to let the client know. The problem is that a bunch of packets of data get buffered up to

C Windows buffer size

半世苍凉 提交于 2019-12-22 12:18:23
问题 In windows lets say i'm using the recv function to receive data from a socket. I'm curious how big would an optimal buffer be? I could make it 1024 bytes or I could make it 51200 bytes, or bigger. I'm wondering which one would be better for performance. This doesn't only apply to the recv function, lets say im reading a large text file, do i want a very large buffer, or a smaller buffer? 回答1: THe operating system performs its own buffering, so the size of your buffer does not really matter.

Error: toString failed Node.js buffer

混江龙づ霸主 提交于 2019-12-22 10:48:22
问题 Sometimes my get request to an api fails with this error message, (btw im using the request module to trigger my requests) Error: toString failed buffer.js:378 throw new Error('toString failed'); ^ Error: toString failed at Buffer.toString (buffer.js:378:11) at BufferList.toString (/home/vardha/www/abp/node_modules/bl/bl.js:155:33) at Request.<anonymous> (/home/vardha/www/abp/node_modules/request/request.js:1013:32) at emitOne (events.js:82:20) at Request.emit (events.js:169:7) at

Communicate data with `count` value close to `INT_MAX`

偶尔善良 提交于 2019-12-22 09:19:45
问题 The Message Passing Interface APIs always use int as a type for count variables. For instance, the prototype for MPI_Send is: int MPI_Send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); This may be a problem if the number of elements to be sent or received grows near or even beyond INT_MAX . Of course the issue may be solved lowering the value of count by either: splitting a single call into multiple calls defining an (unnecessary) aggregate MPI_Datatype

AVPlayer item buffer empty

北城以北 提交于 2019-12-22 08:24:29
问题 I use AVPlayer that plays stream content. I want to know the time when buffer is empty and the time when it is ready to play. But the observers "playbackBufferEmpty" and "playbackLikelyToKeepUp" do not work every time as it needed. They sometimes work but often do not work. I use only iPad simulator iOS 6.1 under OSX 10.7.5. Here is how i set and listen observers: - (void)playAudioStream:(NSURL *)audioStreamURL { if(_audioPlayer && _audioPlayer.currentItem) { [_audioPlayer removeObserver:self

AVPlayer item buffer empty

断了今生、忘了曾经 提交于 2019-12-22 08:22:07
问题 I use AVPlayer that plays stream content. I want to know the time when buffer is empty and the time when it is ready to play. But the observers "playbackBufferEmpty" and "playbackLikelyToKeepUp" do not work every time as it needed. They sometimes work but often do not work. I use only iPad simulator iOS 6.1 under OSX 10.7.5. Here is how i set and listen observers: - (void)playAudioStream:(NSURL *)audioStreamURL { if(_audioPlayer && _audioPlayer.currentItem) { [_audioPlayer removeObserver:self

Python standard idiom to set sys.stdout buffer to zero doesn't work with Unicode

為{幸葍}努か 提交于 2019-12-22 05:39:07
问题 When I'm writing sysadmin scripts in Python, the buffer on sys.stdout that effects every call to print() is annoying, because I don't want to wait for a buffer to be flushed and then get a big chunk of lines at once on the screen, instead I want to get individually lines of output as soon as new output is generated by the script. I don't even want to wait for newlines so see the output. An often used idiom to do this in python is import os import sys sys.stdout = os.fdopen(sys.stdout.fileno()

Audio Queue is playing too fast when the buffer size is small

怎甘沉沦 提交于 2019-12-22 05:36:20
问题 I am able to stream and play m4a files using Audio File Services + Audio Queue Services. Bitrate information of the file is not available to the Audio Queue because of file type. After downloading the all of the audio packets I feed them to the player. When I choose a buffer size around 32768 or 16384 since callbacks are called less often and and each buffer size is big, it seems it is playing almost at regular speed. Problem is sometimes I have to play small files as well but when I choose a

windows console program stdout is buffered when using pipe redirection

女生的网名这么多〃 提交于 2019-12-22 05:10:56
问题 i have a long run server program(say, program A) which is written in QT/c++. the program is not so stable so i decide to write a python script to restart it if it crashes. the problem is that the program may started fail(if i gave it an in-use port), print the error and then just hang there without quitting, so i must monitor the stdout of the program and kill it on failed startup. this is a piece of my final code (well, in fact this is ok, you can just ignore it): self.subp = subprocess