« Return to Thread: Audigy Channels

Re: Audigy Channels

by jhigh@ewation.co.za :: Rate this Message:

Reply to Author | View in Thread

music.columbia.edu - JSyn mailing list wrote:
Hello,

 > Is it possible to output to any other lineout channels of the
 > Audigy soundcard other than the front 2?

For multi-channel devices, you can create a ChannelOut(index) instead of
a LineOut.

http://www.softsynth.com/jsyn/docs/autodocs/com/softsynth/jsyn/ChannelOut.html

You can query the channels an audio device has using AudioDevice:

http://www.softsynth.com/jsyn/docs/autodocs/com/softsynth/jsyn/AudioDevice.html


Thank you,
Phil Burk
---------------------------------------
SoftSynth, Audio Research and Development
http://www.softsynth.com/
75 Pleasant Lane, San Rafael, CA, 94901 USA
Phone/FAX: 1-415-453-4320
---------------------------------------
_______________________________________________
JSyn mailing list
JSyn@music.columbia.edu
To change digest mode or to make other administrative changes visit:
http://music.columbia.edu/mailman/listinfo/jsyn
Hi

I have tried a number of different routes, is it something specific to ASIO or the WMME dll's? I have been using the ChannelOut for some time.

Here something I wrote to test it :

import java.io.IOException;

import javax.sound.sampled.UnsupportedAudioFileException;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import com.softsynth.jsyn.AudioDevice;
import com.softsynth.jsyn.ChannelOut;
import com.softsynth.jsyn.SineOscillator;
import com.softsynth.jsyn.Synth;
import com.softsynth.jsyn.SynthContext;

public class Engine implements Runnable
{
  private Logger logger = Logger.getLogger(getClass());

  private SynthContext context;

  // Global server running flag
  private boolean synth_engine_running = false;

  protected SynthContext getSynthContext()
  {
    return context;
  }

  /**
   *
   */
  public void run()
  {
    PropertyConfigurator.configure("logger.properties");

    initialize();

    while (synth_engine_running)
    {
      serverWait();
    }
  }

  /**
   * Wait for activity on the server.
   */
  private synchronized void serverWait()
  {
    try
    {
      wait();
    } catch (InterruptedException e)
    {
      logger.debug("Thread Interupted : " + e.getMessage());
    }
  }

  /**
   * Initialize the audio device configured.
   */
  private void initialize()
  {
    logger.info(Synth.getVersion());

    context = new SynthContext();
    context.setTrace(Synth.TERSE);

    // Output the devices for configuration purposes.
    printDevices();

    // The context must be initialized otherwise the VM crashes.
    context.initialize();
   
    // Start the context instance, if successful flag the server as running.
    context.start(Synth.FLAG_ENABLE_INPUT, 192000, AudioDevice.getDefaultInputDeviceID(), 1, AudioDevice
        .getDefaultOutputDeviceID(), AudioDevice.getMaxOutputChannels(AudioDevice.getDefaultOutputDeviceID()));
    //    
    synth_engine_running = true;
  }

  public boolean isEngineRunning()
  {
    return synth_engine_running;
  }

  /**
   * Output a list of devices available on this system.
   */
  private void printDevices()
  {
    for (int i = 0; i < AudioDevice.getNumDevices(); i++)
    {
      logger.info(i + " : " + AudioDevice.getName(i) + " / Input=" + AudioDevice.getMaxInputChannels(i) + " / Output="
          + AudioDevice.getMaxOutputChannels(i));
    }
  }

  public static void main(String[] args) throws UnsupportedAudioFileException, IOException, InterruptedException
  {
    int tick;
    Engine engine = new Engine();

    Thread engine_thread = new Thread(engine, "Audio Engine Thread");
    engine_thread.start();

    while (!engine.isEngineRunning())
    {
      Thread.sleep(100);
    }

    ChannelOut out = new ChannelOut(engine.getSynthContext(), 3);
    SineOscillator sine = new SineOscillator(engine.getSynthContext());

    tick = engine.getTickStartTime_100ms();

    sine.output.connect(out.input);

    sine.frequency.set(1000);

    out.start(tick);
    sine.start(tick);
  }

  public int getTickStartTime_100ms()
  {
    return (int) (context.getTickCount() + (0.1d * context.getTickRate()));
  }
}

It plays fine on the first 2 channels after that it doesn't play. I have tried this on a normal PCI Audigy card and a USB Sound Blaster Audigy 2 NX

Regards
James

 « Return to Thread: Audigy Channels