3Qs: Position within sample, Multichannel audio, and streaming output

Skip to first unread message

Mark Underwood

Dec 4, 2014, 3:43:23 PM12/4/14
to beadsp...@googlegroups.com

I just stumbled upon Beads while looking for a better Java package to implement a project I'm working on.  It looks like a very good fit, but I have three questions about its capabilities and/or limitations...

The application is simulating the sound of a locomotive... so there's:
  • Engine sounds: looping a sample, then smoothly switching which sample is being looped in response to throttle inputs
  • Auxiliary sounds: playing a bell or horn tone, with effects, together with the engine sound
  • Sound field positioning: adjusting the pan (hopefully in 2 dimensions) of the output to simulate the sound coming from a certain direction and distance.
  • Output Streaming: I'd like to stream the audio over a network feed, so that the audio can be generated on a server but listened to via headphones on a smart phone (there are other non-audio reasons for this arrangement)

So here are my three questions:

  1.  Multichannel Audio:  Can the Beads library handle multichannel audio (4 independent channels, 5.1 or 7.1 surround, or other formats), or is it strictly a stereo output thing, or is the support dependent upon the input file/stream type(s) and output audio gear capabilities?  I can envision having a Beads audio chain for each of an arbitrary number of channels, no?
  2. Streaming Output:  I saw a semi-related question on the board about handling input streams from a network feed. It was suggested that using an InputStream instead of a File should work... would (should?) an OutputStream directed to a URL work for output as well?
  3. Position within a sample:  I'm not sure I'll actually need to do this, but in the previous implementation I came across the "need" to do it... Can a Sample that is playing report its position within the audio data buffer?

OK, that's it for now.  I'm much obliged for your responses.  There is much that appears very much better for my app than my current implementation here, but I'll need to understand the above, to figure out how to approach porting.

Thank you!

- Mark

Oliver Bown

Dec 7, 2014, 6:41:36 PM12/7/14
to beadsp...@googlegroups.com
Hi Mark,

  1.  Multichannel Audio.
Yep. Any number of channels is supported, but no special support for surround, ambisonics etc. Just a basic vector-based panner.
  1. Streaming Output.
Nope, sorry. You could get under the hood and implement this, not that easy though.
  1. Position within a sample.
yes. You can query a SamplePlayer to find its position.

Note in response to another point, SamplePlayer doesn’t actually implement cross-fades looping (naughty me, I should remove the implication from the API), so you’d need to make sure your loops are click free.



You received this message because you are subscribed to the Google Groups "beadsproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.
To post to this group, send email to beadsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/beadsproject.
For more options, visit https://groups.google.com/d/optout.

Mark Underwood

Dec 14, 2014, 12:28:39 AM12/14/14
to beadsp...@googlegroups.com
Thank you for the response, Ollie.  That's good news.  Time to start writing some code.  I may even look into that streaming work.  We'll see.  Got some other obligations to clear up (and a LOT of learning) before I'm free enough to tackle something that deep.

Much obliged, though!

- Mark

Greg Ames

May 16, 2020, 6:59:33 PM5/16/20
to beadsproject
Hi. Any hints on where to look for multichannel audio?

Thank you,

To unsubscribe from this group and stop receiving emails from it, send an email to beadsp...@googlegroups.com.


May 16, 2020, 7:03:02 PM5/16/20
to beadsp...@googlegroups.com
Are there any examples of using multichannel outputs? Maybe 4 .wav files going to separate outputs. I am on a Mac.

Thank you,


To unsubscribe from this group and stop receiving emails from it, send an email to beadsproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beadsproject/21331086-b7f2-42a3-9674-d85cf025c7cb%40googlegroups.com.

Ollie Bown

May 17, 2020, 6:43:45 PM5/17/20
to beadsp...@googlegroups.com
Somewhere in this forum you should find an introduction to how you can set up Jack audio on a Mac and connect Beads to it.

First up get Jack audio installed and get to know it a little if you don’t (e.g., try it out with a DAW). Then you will be able to set up Beads up with a Jack audio IO so that it speaks to Jack.

AudioContext ac = new AudioContext(new AudioServerIO.Jack(), 512);

The Jack server can be set up with a given number of channels. You can also add another argument to the AudioContext constructor that specifies an AudioIOFormat, and specify the number of channels.

I’m sorry that this is not properly documented. It should be.


Reply all
Reply to author
0 new messages