音声録音(音声のみ)を再生するカスタムプレーヤーがあります。オーディオファイルが長い場合、NetStreamクラスはそれをうまくシークしません。16776秒(04:39:36)後、NetStreamシーク機能がファイルの先頭から再開することがわかりました。最短の擬似コードは次のとおりです。
package com.name.player
{
import flash.net.NetConnection;
import flash.net.NetStream;
...
public class StreamingPlayer extends Sprite
{
public var maStream:NetStream;
...
public function aFunction
{
maStream = new NetStream( maConnection );
maStream.inBufferSeek = true; // ==> Generates compile error:
//Error: Access of possibly undefined property inBufferSeek through a reference with static type flash.net:NetStream.
// [mxmlc]
// [mxmlc] maStream.inBufferSeek = true;
// [mxmlc] ^
maStream.play('sName', 0, -1, true);
// Now try these (one at a time)
maStream.seek(16775); // Seeks to the desired position and plays the file till the end
maStream.seek(16776); // Seeks at second 0 ( begining )
maStream.seek(16778); // Seeks at second 0 ( begining )
maStream.seek(16780); // Seeks at second 3
maStream.seek(16786); // Seeks at second 9
maStream.seek(16796); // Seeks at second 19
...
}
...
}
...
}
さまざまな形式(speex、wav)/コード/ビットレートを試しました:-RIFF
(リトルエンディアン)データ、WAVEオーディオ、ITU G.711 A-law、モノラル8000 Hz
-RIFF(リトルエンディアン)データ、WAVEオーディオ、 Microsoft PCM、16ビット、モノラル44100 Hz
-Oggデータ、Speexオーディオ
ファイルサイズや全長は関係ありません。1.1〜1500 MBと04:40:00(17000秒)から14:56:41(53801秒)の間で試してみました。
新しいブラウザにhtml5を使用していますが、古いブラウザをサポートする必要があります(新しいソフトウェアをインストールするために更新できない一部のクライアントPCでは、Flashがすでにインストールされて実行されているため、それらのブラウザソリューションが必要です。 IE6 :()。
Q:
何か間違ったことをしたり、NetStreamerに制限がありますか?また、どのような解決策がある場合、これらの長いファイルを再生できるようにする必要がありますか?
PSフラッシュを扱うのはこれが初めてなので、回答/コメントがある場合は、もう少し明確にするようにしてください。
編集: AdobeID3492103にバグを追加しました。
編集:
私にはストリームサーバーをテストしている同僚がいて、彼はログに何かが入っているのを見つけました:
// This is lower than 16776 seconds, and works
01-26 13:02:14.277 RtmpProtocol:891 [ID-007] Seeking to 1594380
...
01-26 13:02:14.279 FileReaderWav:194 [ID-007] <Stream0001> Seeking to 15943804 sf_seek 127550432
...
01-26 13:02:16.250 FileReaderWav:230 [ID-007] <Stream0001> Current position: 15943824
// This is when it plays from the beginning (seeking after 16776 seconds)
// according to the log it should just play at the desired position, but it's not
01-26 13:02:23.294 RtmpProtocol:891 [ID-007] Seeking to 16990012
01-26 13:02:23.303 FileReaderWav:194 [ID-007] <Stream0001> Seeking to 16990012 sf_seek 135920096
01-26 13:02:23.463 FileReaderWav:230 [ID-007] <Stream0001> Current position: 16990032
ストリームサーバー、INTEGERキャストなどに問題があります。詳細がわかりましたら更新します。
ありがとうございました