Hi Christopher,

Thanks for the quick answer. Yes, as you say, I want to be able to do at least simple sound filtering (ie. have the sound pass through a set of filters and getting a good output).
I have tried changing the transfer size but it doesn't seem to help at all.

From earlier tests I had found out that even for a very straightforward script using Javasound, the required buffer size is pretty high (2048 on a Mac iBook G4) (see https://lethe.koumbit.net/trac/drone/wiki/DevNotes/SwitchingToJava#Lowlatencyissues). We were able to achieve a much more acceptable performance (buffer size = 64) using the JASS library (see http://www.cs.ubc.ca/~kvdoel/jass/). I think this is the key, so I'll try to reimplement using JASS instead.

++ js

Christopher Brooks wrote:
Hi JS,
Edward created ptolemy/actor/lib/javasound/ClipPlayer.java, which
plays a sound file.  This actor is in the CVS tree, it is not
yet released.  The DE demo RealTimeComposite uses ClipPlayer.
See http://chess.eecs.berkeley.edu/ptexternal for CVS access.

However, it sounds like you want to play audio data directly, not
files.

Ptolemy II does includes an interface to the Java Media Framework
(JMF), see ptolemy.actor.lib.jmf. There is an AudioPlayer actor in the jmf file.

The C codegen interface also has an interface to SDL, so that can be used to generate sound. You could also use the EmbeddedC actor
to call the C based SDL from Java.

One thing to look at with AudioPlayer is how large chunks of audio
data are that you are passing around.  Try changing the transferSize
of AudioPlayer and see how that works for you.

_Christopher

--------

    Hi,
I'm trying to build an application with PtII that can:
    1- read audio files
2- extract raw information (ie. amplitude) to control something else (like, say, the intensity of a light or the saturation of a video)
    3- play the file
I can do (1) and (2) pretty easily with the AudioReader actor BUT if I plug it into the AudioPlayer the sound output is really poor. Even with this very simple app (AudioReader -> AudioPlayer) I can hear "clicks" indicating a poor latency (and unacceptable for a media application). Christopher pointed out a long time ago that the C codegen facility had an interface to Simple DirectMedia Layer. Could that be a solution? What about JMF? -- J. S. Senécal
    http://drone.ws
---------------------------------------------------------------------------
   -
    Posted to the ptolemy-hackers mailing list.  Please send administrative
    mail for this list to: [EMAIL PROTECTED]
--------

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]



--
J. S. Senécal
http://drone.ws


----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to