• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending audio to Browser

 
Ron Bartlet
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm having trouble sending an audio file to Firebird with Quicktime plugin. The sound stops after about 5 seconds, chopping off the rest of the audio. The same in IE works fine (also with quicktime). I get the same effect sending a WAV file.

The problem seems to be that the stream is being read and played by the browser as soon as the stream write executes (with IE only on close of stream). I assume it is read faster than the write can fill and the audio therefore terminates prematurely.

Any help would be appreciated.

Thanks






[ September 28, 2006: Message edited by: Ron Bartlet ]
[ September 28, 2006: Message edited by: Ron Bartlet ]
 
Asad Imtiaz
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ron, did you ever get the solution to this ? or anyone else ?
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution is in our FAQ: ReadDoesntDoWhatYouThinkItDoes
 
Asad Imtiaz
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Joe. Well i took a look at the link and i think i am pretty much doing what it said already my code looks like this


As Ron said this code works fine for IE (using IE7) but in Firefox 3.x i get only 5 seconds of playback where as the actual playback time is 30 seconds.
 
Ron Bartlet
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better late than never. Just found out that this seems to be still open.

The solution is to set the size of the wav/mp3 file first in the response. This way the browsers will wait until the complete audio has been transferred and not start playing as soon as the first 5 seconds of audio arrives:

response.setContentLength(filelen);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!