Re: How to play .AU files with Fedora?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>I have some .AU files which have no association under GNOME.
>I tried the "media player", and no sound comes out.
>"Music Player" won't recognize them at all.
>
>What app should I associate to play .AU files?
>
>Thanks
>
>Mike

Sun audio file.  Very easy to play with Java.

import java.io.*;
import javax.sound.sampled.*;

public class Play {
    public static void main(String[] args) {
        try {
            AudioInputStream ais =
                AudioSystem.getAudioInputStream(new File(args[0]));
            AudioFormat af = ais.getFormat();
            System.out.println("Format: " + af.toString());

            int frameRate = (int)af.getFrameRate();
            System.out.println("Frame Rate: " + frameRate);
            int frameSize = af.getFrameSize();
            System.out.println("Frame Size: " + frameSize);

            SourceDataLine line = AudioSystem.getSourceDataLine(af);
            line.open(af);
            int bufSize = line.getBufferSize();
            System.out.println("Buffer Size: " + bufSize);
            
            line.start();

            byte[] data = new byte[bufSize];
            int bytesRead;

            while ((bytesRead = ais.read(data,0,data.length)) != -1)
                line.write(data,0,bytesRead);
            
            line.drain();
            line.stop();
            line.close();
        } catch (Exception e) {
            System.out.println(e.toString());
        }
    }
}
-- 
Knute Johnson
Molon Labe...


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux