java - Javav Sound selecting DataLines and Ports at runtime -
i understand concept of targetdataline , sourcedataline , have written program list them ports , available controls each. test progam have onboard mic, on board speakers, line in, speaker jack , audio interface 2 inputs , 1 output. inputs on interface treated left , right i'm not sure how differentiate between 2 if act 1 stereo input.
i want able select dataline want use either recording or playback @ runtime. how can identify , separate inputs , outputs list them , allow user select specific 1 use? , if has suggestions handling interface input 2 mono inputs helpful well. in advance.
to convert 2 mono lines stereo requires interleaving left , right, 1 "sample" @ time. size of sample depends on bit depth. example, 16-bit encoding consumes 2 bytes. so, take 2 bytes left, 2 bytes right. repeat duration of lines.
there may prebuilt methods this. check out section in java sound tutorials section on converting formats--it's 4th or 5th section of sound tutorials, , happens best written of bunch if remember correctly. (actual sample code provided, unlike of rest of difficult tutorial.)
i'm not sure how selecting line or port different programming selecting else. make list, , user clicks button associated item, or selects item drop down, plug in.
i have theremin made menubar allows 1 select mixer line. populates radio button set names of mixers found. when select item listener directs 1 install associated mixer.
Comments
Post a Comment