Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > javax.sound streaming

Reply
Thread Tools

javax.sound streaming

 
 
taylorius
Guest
Posts: n/a
 
      08-25-2003
I am converting some sound code from old style sun audio to
javax.sound
The sound I'm playing is already resident in memory, so I'm converting
it to an AudioInputStream, and playing it via a Clip.
All well and good, except some of the sounds are on the large side, (>
1Mb) and I get "Requested buffer too large" exceptions. Fair enough, I
suppose clips are only designed for small samples.

My question is, is there a method of playing an arbitrary sized sound
sample that is resident in memory, without having to spoon feed the
data to the audio Line myself (line events etc). I like the behaviour
of a clip (just gets on and plays the sound), but in my situation, it
needn't copy the data (I presume this is where it is failing on the
large samples), as it is already resident in memory.

Many thanks for any help people may be able to offer


Matthew Taylor
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      08-29-2003
taylorius wrote:
> I am converting some sound code from old style sun audio to
> javax.sound
> The sound I'm playing is already resident in memory, so I'm converting
> it to an AudioInputStream, and playing it via a Clip.
> All well and good, except some of the sounds are on the large side, (>
> 1Mb) and I get "Requested buffer too large" exceptions. Fair enough, I
> suppose clips are only designed for small samples.
>
> My question is, is there a method of playing an arbitrary sized sound
> sample that is resident in memory, without having to spoon feed the
> data to the audio Line myself (line events etc). I like the behaviour
> of a clip (just gets on and plays the sound), but in my situation, it
> needn't copy the data (I presume this is where it is failing on the
> large samples), as it is already resident in memory.
>
> Many thanks for any help people may be able to offer
>
>
> Matthew Taylor


There is a finite limit to Clip size. I don't remember what but you've
probably exceeded it. Just make a loop and write the data to a
SourceDataLine.



--

Knute Johnson
email s/nospam/knute/
Molon labe...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Streaming radio options? news@celticbear.com Firefox 3 01-03-2005 05:29 PM
Streaming video senoj Firefox 17 07-30-2004 04:35 AM
Re: Streaming Audio Problem news_naught Firefox 0 07-27-2003 02:24 AM
Re: Streaming Audio Problem Irmen de Jong Firefox 1 07-17-2003 08:01 PM



Advertisments