Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Access to the sound InputStream  (Read 3722 times)
0 Members and 1 Guest are viewing this topic.
Offline helgefredriksen

Innocent Bystander





« Posted 2006-09-13 21:32:44 »

Hello!

I want to grab bytes from a sound device using joal given a chosen device and a chosen format. Is that possible with joal? Any advice on how to achieve that?

PS: Would be nice with a wrapped up zip containing all external jar dependencies for people wanting to play around with/compile the code. I just had to give it up...

Regards,
Helge Fredriksen
Offline Ultraq

Junior Member




That's what she said


« Reply #1 - Posted 2006-09-13 23:18:00 »

If OpenAL can do it, then so can JOAL.  While I've never used this feature myself, there are OpenAL functions which look like they're related to capturing the sound going to the device.  Whether it's the raw waveform or the post-processed data, I'm not sure.  The commands are:
 - alcCaptureOpenDevice
 - alcCaptureCloseDevice
 - alcCaptureStart
 - alcCaptureStop
 - alcCaptureSamples

There's a bit of info in the OpenAL 1.1 spec document about how to use it.  To summarize:
 - create a capture buffer using alcCaptureOpenDevice (here you can specify a format and device)
 - start audio capture using alcCaptureStart
 - when the app thinks there's enough data in the buffer (you can query it), get it using alcCaptureSamples
 - (you can pause capturing as an optimization, using alcCaptureStop)
 - disconnect from the capture device with alcCaptureCloseDevice

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #2 - Posted 2006-09-14 00:29:19 »

PS: Would be nice with a wrapped up zip containing all external jar dependencies for people wanting to play around with/compile the code. I just had to give it up...

Yes, sorry about that. We'll try to improve the bits the nightly build generates this or next week.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline willbracken

Junior Newbie





« Reply #3 - Posted 2007-02-03 20:31:29 »

is there perhaps a java version of this tutorial?
http://www.devmaster.net/articles/openal-tutorials/lesson8.php
Offline operator

Senior Newbie





« Reply #4 - Posted 2007-02-04 10:11:01 »

hi,

you should have a look at the openal sdk capture sample (c++).
http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&top=38&aid=45&file=OpenAL11CoreSDK.exe&l=1

what Ulraq didnt mention is the enumeration of the input devices. the capture sample uses "alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);" to get a double null terminated string containing all input devices.
if you have more than one inputdevices, it would be very interesting if alc.alcGetStringImpl(NULL, ALC.ALC_CAPTURE_DEVICE_SPECIFIER) returns all of them.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #5 - Posted 2007-04-08 18:43:08 »

Thanks for the suggestion. I've added ALC.alcGetCaptureDeviceSpecifiers() (in similar fashion to alcGetDeviceSpecifiers(), which was already there). This should show up in JOAL nightly builds dated 4/9 and later.
Offline operator

Senior Newbie





« Reply #6 - Posted 2007-04-09 21:27:40 »

thx
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (38 views)
2014-04-15 18:08:23

BurntPizza (34 views)
2014-04-15 03:46:01

UprightPath (50 views)
2014-04-14 17:39:50

UprightPath (32 views)
2014-04-14 17:35:47

Porlus (49 views)
2014-04-14 15:48:38

tom_mai78101 (71 views)
2014-04-10 04:04:31

BurntPizza (130 views)
2014-04-08 23:06:04

tom_mai78101 (230 views)
2014-04-05 13:34:39

trollwarrior1 (193 views)
2014-04-04 12:06:45

CJLetsGame (200 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!