Author Topic: EzAudDac called from Java  (Read 22149 times)

0 Members and 1 Guest are viewing this topic.

Agent C

  • Guest
EzAudDac called from Java
« on: November 15, 2009, 03:12:38 pm »
Muhahaha.  Only took about an hour once I found a good library for calling DLL's (would also work for linux shared objects!)

I'm using the JNative interface, which is OSS, as opposed to the rapeware we found last night.

  println("dll test");
  JNative.setLoggingEnabled(true);
  try
  {
    int blah = org.xvolks.jnative.util.EzAudDac.EzAudDacGetCardNum();
    println(blah);
  }

output:
dll test

Nov 15, 2009 3:06:16 PM, [DEBUG]Creating Lib info (name = EzAudDac.dll, handle = cd50000, inUseFor = 1)

1

Yay!  Awesome stuff dude, I'll try flinging some data at it later this evening.  I think if you compile a dll for sauce that takes a similar data structure and makes optimized points we'll be super awesome!

JNative link is here:
http://jnative.free.fr/SPIP-v1-8-3/

Offline drlava

  • Moderator
  • Sr. Member
  • *****
  • Posts: 314
  • Milliwatts: 18
    • View Profile
Re: EzAudDac called from Java
« Reply #1 on: November 15, 2009, 03:29:54 pm »
Good find!  I love it things work together.  One thing I forgot to mention last night is that there is a function to check whether the last frame has been displayed, EzAudDacGetStatus(in CardNum) will return 1 if it's ready for a new frame, 2 if it's still buffering the last frame.

Agent C

  • Guest
Re: EzAudDac called from Java
« Reply #2 on: November 16, 2009, 12:19:35 am »
And I've got output!  I'm upstairs in my office and the laser is in the basement, so the output is just farting over my speakers. It'll be another weekend before I get to hook everything together.

It's great what can be developed over a few beers.

JNative is pretty neat, I'll be using it more and more I think.  On Saturday you raised the * point about pointers.  JNative provides a mechanism to allocate heap memory to stuff bytes into and then return a pointer to that location which is then passed to the dll in the function call.  Does this stuff look familiar?

dll test

Nov 16, 2009 12:18:06 AM, [DEBUG]Creating Lib info (name = EzAudDac.dll, handle = cd50000, inUseFor = 1)

1

Nov 16, 2009 12:18:07 AM, [DEBUG]Using org.xvolks.jnative.pointers.memory.HeapMemoryBlock memory reservation strategy
Nov 16, 2009 12:18:07 AM, [DEBUG]Resusing Lib info (name = EzAudDac.dll, handle = cd50000, inUseFor = 2)

 EzSound Dac Driver V1.08b by Andrew Kibler
 Loading file: F:\WINDOWS\system32\EzAudDac.ini
 Searching for sounds cards..
 Sound Card 1 : Realtek HD Audio output
 Sound Card 2 : USB Audio
 Found 2 Sound Cards.
 SoundCard 1 Initializing...
 SoundCard 1 Initialized. Speakers:2 Latency:2ms Minbuf:48 ms
 SoundstreamCreated. (2952790017)
 SoundOutputStarted
 Sound init done.

Offline drlava

  • Moderator
  • Sr. Member
  • *****
  • Posts: 314
  • Milliwatts: 18
    • View Profile
Re: EzAudDac called from Java
« Reply #3 on: November 16, 2009, 12:39:45 am »
Nice.  Yes, that is the info it sends to STDOUT during GetCardNum

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2024, SimplePortal