java - Object Array of length 0 but it still contains Info -
below have pasted code have been working on. need target line mixer can't figure out how request 1 line.info[] array. has length of 0 if output string holds single line of information. want cast don't know how properly.
thanks, hat
package soundconnect; import javax.sound.sampled.audiosystem; import javax.sound.sampled.line; import javax.sound.sampled.lineunavailableexception; import javax.sound.sampled.mixer; public class soundconnect { /** * @param args command line arguments */ public static void main(string[] args) throws lineunavailableexception { mixer.info [] mixes = audiosystem.getmixerinfo(); mixer sys_mix = audiosystem.getmixer(mixes[1]); line.info[] t_nfo = sys_mix.gettargetlineinfo(); line line1 = sys_mix.getline(t_nfo[0]); /* t_nfo has length of 0 has information when output * */ } }
when output string, mean you're calling tostring()
method of array
, object in java. print out memory address , class name array. default tostring() printing array object has nothing elements in array. print same value regardless of what's stored inside of it, including if has 0
length.
Comments
Post a Comment