Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Streaming Audio

Reply
Thread Tools

Streaming Audio

 
 
Matthew Zimmer
Guest
Posts: n/a
 
      04-03-2004
Hi all,
I currently have a baduk game online that is written in java. I am
trying to add a new feature to it: the ability for someone playing a
game to chat with people watching it. Here's the basic setup:

- I have a central server that runs everything.
- All communication from one client to another goes through the server.
- One client will speak into their microphone, and anybody who chooses
to and is listening to the game will hear what they say.

I've been playing around with the JMF and have become fairly frustrated
with the lack of decent examples. Here's what I've managed to accomplish:

- I can record from a microphone.
- I can play back a file that is saved from the microphone.
- I have all the connections to the server set up.

For the recording and the playing I've been using the classes in
javax.sound.sampled.

Here's what I haven't managed to figure out:

- How can I break up the input from the microphone into small packets
and send them one at a time.
- Then, when I receive the small packet, how can I actually play them.

Everything I've been reading says to use RTP. However, I would rather
not use RTP as I have all the issues solved with transmitting the data
to and from the clients and the servers, including all the issues of who
should get what sound when. Is there some other mechanism I can use to
break up the audio sound, and if so does anybody know of any good
references to help with this?

Thanks,
Matthew Zimmer
 
Reply With Quote
 
 
 
 
Matthew Zimmer
Guest
Posts: n/a
 
      04-03-2004
I should add that I'm not comletely against RTP if that's the only way
to go. However, if that's the only/best way, does anybody know of any
good resources (on the web or in book form) that have some decent
examples for java through the JMF?
Thanks,
Matthew
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      04-03-2004
Matthew Zimmer wrote:
> I should add that I'm not comletely against RTP if that's the only way
> to go. However, if that's the only/best way, does anybody know of any
> good resources (on the web or in book form) that have some decent
> examples for java through the JMF?
> Thanks,
> Matthew


You can use Java Sound and read and write to streams to collect and play
your audio. See TargetDataLine, SourceDataLine, and AudioSystem.

--

Knute Johnson
email s/nospam/knute/
Molon labe...
 
Reply With Quote
 
Matthew Zimmer
Guest
Posts: n/a
 
      04-17-2004


Knute Johnson wrote:
>
> You can use Java Sound and read and write to streams to collect and play
> your audio. See TargetDataLine, SourceDataLine, and AudioSystem.
>


Thanks for the response. I've managed to get the streaming voice
working, but have a problem where every packet I try to play on the
client "clicks". I've tried changing the buffer size for the lines, but
all I seem to manage to change is the rate of clicks. Anybody have any
ideas on this?

Thanks,
Matthew
 
Reply With Quote
 
Matthew Zimmer
Guest
Posts: n/a
 
      04-17-2004
Matthew Zimmer wrote:

>
> Thanks for the response. I've managed to get the streaming voice
> working, but have a problem where every packet I try to play on the
> client "clicks". I've tried changing the buffer size for the lines, but
> all I seem to manage to change is the rate of clicks. Anybody have any
> ideas on this?
>


Okay, I figured the click thing out. For those who might be curious, I
had created the output line inside of my loop so every time a new packet
came in I reopened the source. By moving it outside the loop, things
worked great.
 
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
drop off when using streaming audio with linksys router Ron Wireless Networking 0 02-17-2006 04:16 AM
Streaming Audio/Video Crashes DSL/Cable Connection Guy Quinn Wireless Networking 0 12-31-2005 09:12 PM
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