Re: [Alsa-user] Not able to play multiple audio files.

On Fri, Nov 29, 2013 at 7:49 AM, Clemens Ladisch <cladisch@...>wrote:
> sai wrote:
> > I think from 1.6.0_30, OSS is dropped and I thought ALSA is the default
> audio framework for java.
>
> Nobody mentioned OSS.
>
> > I do not know how the java program selects the output device.
>
> Neither do I.
>
> It appears the first device listed by OpenJDK is "default", which is what
> you want. However, either your Java program or your OpenJDK configuration
> do something different. I don't know how this could be changed.
>
Does this help?
http://docs.oracle.com/javase/tutorial/sound/accessing.html
>
>
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.

Thread view

Hello all,
I have some problem playing multiple audio files using ALSA on my
ubuntu machine through java. I have a jar file that takes an audio
clip as an argument and plays the audio clip continuously in a loop.
In the java code, continuously different instances of the audio clip
passed as an argument are initiated, as time progresses. So, on
running the jar file for some time, different instances of the audio
file passed as an argument are created, and all instances of the audio
clip will be playing simultaneously.
Initially, I could not hear the audio being played from different
instances simultaneously. But, later I inserted two modules
'snd_mixer_oss' and 'snd_pcm_oss'. Then, up on running the jar file,
after some time i.e., when different instances of the audio file are
initiated, I could hear different instances of the audio file being
played simultaneously(Could make out audio clips overlapping). Now my
question is, are these some kind of oss emulation modules? If so, will
that be supported by ALSA in future?
One more question I have is, even after inserting the modules, I can
not run two instances of the jar file passing different audio files
and listen both of them being played simultaneously.
I'm eagerly waiting for a reply. Pardon if this is a mundane question.
I'm new to this.
Thank you very much in advance.
Regards,
Sai.

sai wrote:
> I'm able to play multiple audio files being played simultaneously with aplay
> command. But this is not the case with java in picture(with the jar file).
aplay uses the "default" device, which allows software mixing. Apparently,
your JVM bypasses this.
> So, as you said may be I need to configure JVM's audio output. Can you help
> me doing so?
I don't know which JVM you are using.
<https://help.ubuntu.com/community/Java&gt;
Regards,
Clemens

sai wrote:
> I think from 1.6.0_30, OSS is dropped and I thought ALSA is the default audio framework for java.
Nobody mentioned OSS.
> I do not know how the java program selects the output device.
Neither do I.
It appears the first device listed by OpenJDK is "default", which is what
you want. However, either your Java program or your OpenJDK configuration
do something different. I don't know how this could be changed.
Regards,
Clemens

On Fri, Nov 29, 2013 at 7:49 AM, Clemens Ladisch <cladisch@...>wrote:
> sai wrote:
> > I think from 1.6.0_30, OSS is dropped and I thought ALSA is the default
> audio framework for java.
>
> Nobody mentioned OSS.
>
> > I do not know how the java program selects the output device.
>
> Neither do I.
>
> It appears the first device listed by OpenJDK is "default", which is what
> you want. However, either your Java program or your OpenJDK configuration
> do something different. I don't know how this could be changed.
>
Does this help?
http://docs.oracle.com/javase/tutorial/sound/accessing.html
>
>
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.

Hello all,
Thank you very much for your replies.
But, even with java version 1.6.0_45 there still exists the problem of
playing multiple audio clips. I'm using ALSA which comes as default with
ubuntu. When I play multiple audio clips, I'm not able to hear any audio.
Might be because there should be some configuration changes to be done so
that mixer will come into play and I would be able to hear multiple audio
clips. I have not done any configuration changes till now.
Can you kindly help me. I've been struggling with this since long time.
Thank you all once again for spending your valuable time reading this.
Regards,
Sai.
On Fri, Nov 29, 2013 at 9:27 PM, chris hermansen <clhermansen@...>wrote:
> On Fri, Nov 29, 2013 at 7:49 AM, Clemens Ladisch <cladisch@...>wrote:
>
>> sai wrote:
>> > I think from 1.6.0_30, OSS is dropped and I thought ALSA is the default
>> audio framework for java.
>>
>> Nobody mentioned OSS.
>>
>> > I do not know how the java program selects the output device.
>>
>> Neither do I.
>>
>> It appears the first device listed by OpenJDK is "default", which is what
>> you want. However, either your Java program or your OpenJDK configuration
>> do something different. I don't know how this could be changed.
>>
>
> Does this help?
>
> http://docs.oracle.com/javase/tutorial/sound/accessing.html
>
>>
>>
>
>
>
> --
> Chris Hermansen · clhermansen "at" gmail "dot" com
>
> C'est ma façon de parler.
>