AudioSystemTest.frink

Download or view AudioSystemTest.frink in plain text format


/** This demonstrates working with sampled sounds, e.g., the packages in
    javax.sound.sampled.

    Maybe see:
https://stackoverflow.com/questions/32347274/how-to-play-record-sound-on-from-a-javax-sound-sampled-line

   and
      https://docs.oracle.com/javase/tutorial/sound/sampled-overview.html
*/


/** List the file formats supported for writing */
println["File formats supported for writing:"]
fTypes = callJava["javax.sound.sampled.AudioSystem", "getAudioFileTypes", []]
for ft = fTypes
   println[ft.toString[]]

/** List the available mixers. */
println[]
println["Mixers available:"]
mTypes = callJava["javax.sound.sampled.AudioSystem", "getMixerInfo", []]
for mixerInfo = mTypes
{
   println[mixerInfo.toString[]]
   println["\t" + mixerInfo.getDescription[]]
   println[]
}

/** Get the default mixer. */
mixer = callJava["javax.sound.sampled.AudioSystem", "getMixer", [undef]]
println["Source lines:"]
lineInfos = mixer.getSourceLineInfo[]
for li = lineInfos
   println[li.toString[]]

println["\nTarget lines:"]
lineInfos = mixer.getTargetLineInfo[]
for li = lineInfos
   println[li.toString[]]


Download or view AudioSystemTest.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20139 days, 6 hours, 28 minutes ago.