Author Topic: SoundSystem: Playing rawAudioData(..) Stream  (Read 2967 times)

Offline Gliby

  • bit
  • Posts: 4
    • View Profile
SoundSystem: Playing rawAudioData(..) Stream
« on: November 26, 2013, 10:36:20 AM »
Hi I am working on a streaming program, but I am having some trouble with playing the stream!

When I start receiving data from client ->
Code: newbielink:javascript:void(0); [nonactive]
String identifier = generateSource(data);
sndSystem.rawDataStream(universalAudioFormat, false, identifier, 0, 0, 0, 0, 0);
//Feeds initial data
                sndSystem.feedRawAudioData(identifier, data.getData());
sndSystem.setVolume(identifier, 1.0f);
sndSystem.setPitch(identifier, 1.0f);
                //Start playing stream;
When I receive more data from client ->
Code: newbielink:javascript:void(0); [nonactive]
sndSystem.feedRawAudioData(generateSource(data), data.getData());

I have this problem that nothing plays, at all. Even after all the data has been filled in the source nothing plays...

Also I assume using; will start a stream and will play feed samples automatically?
« Last Edit: November 27, 2013, 06:24:51 AM by Gliby »

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: SoundSystem: Playing rawAudioData(..) Stream
« Reply #1 on: November 27, 2013, 02:31:37 PM »
There are some bugs with raw data streams related to a certain configuration of data needing to be queued before playing, and the stream playing before setting source parameters.  This is something I will be fixing soon (not sure if this problem is related)  In the mean time, you might be able to get around the problem by queuing up a couple of initial buffers of data before playing, and making sure they are valid audio data and large enough.  Also, if you are using one of the OpenAL library plugins, make sure the stream of data is continuous (on some hardware, a gap in the data will cause the AL source to stop, requiring another call to play).  You might try creating a basic test-case, where you are feeding data read in by one of the codec plugins directly into a raw data stream, to see if you can get it going that way.  If you are using the JavaSound library plugin, audio may simply not work on the available mixers on your system.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Gliby

  • bit
  • Posts: 4
    • View Profile
Re: SoundSystem: Playing rawAudioData(..) Stream
« Reply #2 on: November 28, 2013, 08:19:55 AM »
Well I tried queuing up some valid audio, just by putting the initial audio data in a few times(each buffer is 1280)
Code: newbielink:javascript:void(0); [nonactive]

for(int i = 0; i < 10; i++) {
  sndSystem.feedRawAudioData(identifier, data.getData());

And still no luck :(